public static void expandReal(String numberString,WordRelation wordRelation,Item tokenItem){
  int stringLength=numberString.length();
  int position;
  if (numberString.charAt(0) == '-') {
    wordRelation.addWord(tokenItem,"minus");
    expandReal(numberString.substring(1,stringLength),wordRelation,tokenItem);
  }
 else   if (numberString.charAt(0) == '+') {
    wordRelation.addWord(tokenItem,"plus");
    expandReal(numberString.substring(1,stringLength),wordRelation,tokenItem);
  }
 else   if ((position=numberString.indexOf('e')) != -1 || (position=numberString.indexOf('E')) != -1) {
    expandReal(numberString.substring(0,position),wordRelation,tokenItem);
    wordRelation.addWord(tokenItem,"e");
    expandReal(numberString.substring(position + 1),wordRelation,tokenItem);
  }
 else   if ((position=numberString.indexOf('.')) != -1) {
    String beforeDot=numberString.substring(0,position);
    if (beforeDot.length() > 0) {
      expandReal(beforeDot,wordRelation,tokenItem);
    }
    wordRelation.addWord(tokenItem,"point");
    String afterDot=numberString.substring(position + 1);
    if (afterDot.length() > 0) {
      expandDigits(afterDot,wordRelation,tokenItem);
    }
  }
 else {
    expandNumber(numberString,wordRelation,tokenItem);
  }
}

public static void expandReal ( String numberString , WordRelation wordRelation , Item tokenItem ) { int stringLength = numberString . length ( ) ; int position ; if ( numberString . charAt ( 0 ) == '-' ) { wordRelation . addWord ( tokenItem , "minus" ) ; expandReal ( numberString . substring ( 1 , stringLength ) , wordRelation , tokenItem ) ; } else if ( numberString . charAt ( 0 ) == '+' ) { wordRelation . addWord ( tokenItem , "plus" ) ; expandReal ( numberString . substring ( 1 , stringLength ) , wordRelation , tokenItem ) ; } else if ( ( position = numberString . indexOf ( 'e' ) ) != - 1 || ( position = numberString . indexOf ( 'E' ) ) != - 1 ) { expandReal ( numberString . substring ( 0 , position ) , wordRelation , tokenItem ) ; wordRelation . addWord ( tokenItem , "e" ) ; expandReal ( numberString . substring ( position + 1 ) , wordRelation , tokenItem ) ; } else if ( ( position = numberString . indexOf ( '.' ) ) != - 1 ) { String beforeDot = numberString . substring ( 0 , position ) ; if ( beforeDot . length ( ) > 0 ) { expandReal ( beforeDot , wordRelation , tokenItem ) ; } wordRelation . addWord ( tokenItem , "point" ) ; String afterDot = numberString . substring ( position + 1 ) ; if ( afterDot . length ( ) > 0 ) { expandDigits ( afterDot , wordRelation , tokenItem ) ; } } else { expandNumber ( numberString , wordRelation , tokenItem ) ; } }
expands the given number string as a real number .
