@Nullable
  private AnalyzedTokenReadings getAnalyzedTokenReadingsFor(int startPos, int endPos, List<AnalyzedTokenReadings> tokenReadings) {
    int pos = 0;
    for (AnalyzedTokenReadings tokenReading : tokenReadings) {
      String token = tokenReading.getToken();
      if (token.trim().isEmpty()) {
        continue;  // the OpenNLP result has no whitespace, so we need to skip it
      }
      int tokenStart = pos;
      int tokenEnd = pos + token.length();
      if (tokenStart == startPos && tokenEnd == endPos) {
        //System.out.println("!!!" + startPos + " " + endPos + "  " + tokenReading);
        return tokenReading;
      }
      pos = tokenEnd;
    }
    return null;
  }
@ Nullable private AnalyzedTokenReadings getAnalyzedTokenReadingsFor ( int startPos , int endPos , List < AnalyzedTokenReadings > tokenReadings ) { int pos = 0 ; for ( AnalyzedTokenReadings tokenReading : tokenReadings ) { String token = tokenReading . getToken ( ) ; if ( token . trim ( ) . isEmpty ( ) ) { continue ; } int tokenStart = pos ; int tokenEnd = pos + token . length ( ) ; if ( tokenStart == startPos && tokenEnd == endPos ) { return tokenReading ; } pos = tokenEnd ; } return null ; }
the tokens of "I'll" ([I] ['ll] vs [I]['][ll) cannot be mapped with this.