private String[] splitOutNag(String wordToken){
  if (wordToken.startsWith("$")) {
    int digitEndIndex=1;
    for (int i=1; i < wordToken.length(); i++) {
      if (!Character.isDigit(wordToken.charAt(i))) {
        break;
      }
 else {
        digitEndIndex++;
      }
    }
    if (digitEndIndex <= 1) {
      return null;
    }
 else     if (wordToken.length() == digitEndIndex) {
      return new String[]{wordToken};
    }
 else {
      return new String[]{wordToken.substring(0,digitEndIndex),wordToken.substring(digitEndIndex,wordToken.length())};
    }
  }
  return null;
}

private String [ ] splitOutNag ( String wordToken ) { if ( wordToken . startsWith ( "$" ) ) { int digitEndIndex = 1 ; for ( int i = 1 ; i < wordToken . length ( ) ; i ++ ) { if ( ! Character . isDigit ( wordToken . charAt ( i ) ) ) { break ; } else { digitEndIndex ++ ; } } if ( digitEndIndex <= 1 ) { return null ; } else if ( wordToken . length ( ) == digitEndIndex ) { return new String [ ] { wordToken } ; } else { return new String [ ] { wordToken . substring ( 0 , digitEndIndex ) , wordToken . substring ( digitEndIndex , wordToken . length ( ) ) } ; } } return null ; }
returns null if wordtoken isn ' t a nag . if word token is only a nag then a string [ 1 ] is returned where index 0 = wordtoken . if word token starts with a nag then a string [ 2 ] is returned where 0 = nag and 1 = rest of word . this method is fast and does ' nt use regex for parsing .
