public static void expandID(String numberString,WordRelation wordRelation){
  int numberDigits=numberString.length();
  if ((numberDigits == 4) && (numberString.charAt(2) == '0') && (numberString.charAt(3) == '0')) {
    if (numberString.charAt(1) == '0') {
      expandNumber(numberString,wordRelation);
    }
 else {
      expandNumber(numberString.substring(0,2),wordRelation);
      wordRelation.addWord("hundred");
    }
  }
 else   if ((numberDigits == 2) && (numberString.charAt(0) == '0')) {
    wordRelation.addWord("oh");
    expandDigits(numberString.substring(1,2),wordRelation);
  }
 else   if ((numberDigits == 4 && numberString.charAt(1) == '0') || numberDigits < 3) {
    expandNumber(numberString,wordRelation);
  }
 else   if (numberDigits % 2 == 1) {
    String firstDigit=digit2num[numberString.charAt(0) - '0'];
    wordRelation.addWord(firstDigit);
    expandID(numberString.substring(1,numberDigits),wordRelation);
  }
 else {
    expandNumber(numberString.substring(0,2),wordRelation);
    expandID(numberString.substring(2,numberDigits),wordRelation);
  }
}

public static void expandID ( String numberString , WordRelation wordRelation ) { int numberDigits = numberString . length ( ) ; if ( ( numberDigits == 4 ) && ( numberString . charAt ( 2 ) == '0' ) && ( numberString . charAt ( 3 ) == '0' ) ) { if ( numberString . charAt ( 1 ) == '0' ) { expandNumber ( numberString , wordRelation ) ; } else { expandNumber ( numberString . substring ( 0 , 2 ) , wordRelation ) ; wordRelation . addWord ( "hundred" ) ; } } else if ( ( numberDigits == 2 ) && ( numberString . charAt ( 0 ) == '0' ) ) { wordRelation . addWord ( "oh" ) ; expandDigits ( numberString . substring ( 1 , 2 ) , wordRelation ) ; } else if ( ( numberDigits == 4 && numberString . charAt ( 1 ) == '0' ) || numberDigits < 3 ) { expandNumber ( numberString , wordRelation ) ; } else if ( numberDigits % 2 == 1 ) { String firstDigit = digit2num [ numberString . charAt ( 0 ) - '0' ] ; wordRelation . addWord ( firstDigit ) ; expandID ( numberString . substring ( 1 , numberDigits ) , wordRelation ) ; } else { expandNumber ( numberString . substring ( 0 , 2 ) , wordRelation ) ; expandID ( numberString . substring ( 2 , numberDigits ) , wordRelation ) ; } }
expands the given number string as pairs as in years or ids
