public static void expandOrdinal(String rawNumberString,WordRelation wordRelation,Item tokenItem){
  String numberString=Utilities.deleteChar(rawNumberString,',');
  expandNumber(numberString,wordRelation,tokenItem);
  Item lastItem=wordRelation.getTail();
  if (lastItem != null) {
    FeatureSet featureSet=lastItem.getFeatures();
    String lastNumber=featureSet.getString("name");
    String ordinal=findMatchInArray(lastNumber,digit2num,ord2num);
    if (ordinal == null) {
      ordinal=findMatchInArray(lastNumber,digit2teen,ord2teen);
    }
    if (ordinal == null) {
      ordinal=findMatchInArray(lastNumber,digit2enty,ord2enty);
    }
    if (lastNumber.equals("hundred")) {
      ordinal="hundredth";
    }
 else     if (lastNumber.equals("thousand")) {
      ordinal="thousandth";
    }
 else     if (lastNumber.equals("billion")) {
      ordinal="billionth";
    }
    if (ordinal != null) {
      wordRelation.setLastWord(ordinal);
    }
  }
}

public static void expandOrdinal ( String rawNumberString , WordRelation wordRelation , Item tokenItem ) { String numberString = Utilities . deleteChar ( rawNumberString , ',' ) ; expandNumber ( numberString , wordRelation , tokenItem ) ; Item lastItem = wordRelation . getTail ( ) ; if ( lastItem != null ) { FeatureSet featureSet = lastItem . getFeatures ( ) ; String lastNumber = featureSet . getString ( "name" ) ; String ordinal = findMatchInArray ( lastNumber , digit2num , ord2num ) ; if ( ordinal == null ) { ordinal = findMatchInArray ( lastNumber , digit2teen , ord2teen ) ; } if ( ordinal == null ) { ordinal = findMatchInArray ( lastNumber , digit2enty , ord2enty ) ; } if ( lastNumber . equals ( "hundred" ) ) { ordinal = "hundredth" ; } else if ( lastNumber . equals ( "thousand" ) ) { ordinal = "thousandth" ; } else if ( lastNumber . equals ( "billion" ) ) { ordinal = "billionth" ; } if ( ordinal != null ) { wordRelation . setLastWord ( ordinal ) ; } } }
expands the digit string of an ordinal number .
