public void leaveReading(AnalyzedToken token) {
    List<AnalyzedToken> l = new ArrayList<>();
    AnalyzedToken tmpTok = new AnalyzedToken(token.getToken(), token.getPOSTag(), token.getLemma());
    tmpTok.setWhitespaceBefore(isWhitespaceBefore);
    for (AnalyzedToken anTokReading : anTokReadings) {
      if (anTokReading.matches(tmpTok)) {
        l.add(anTokReading);
      }
    }
    if (l.isEmpty()) {
      l.add(new AnalyzedToken(this.token, null, null));
      l.get(0).setWhitespaceBefore(isWhitespaceBefore);
    }
    anTokReadings = l.toArray(new AnalyzedToken[0]);
    setNoRealPOStag();
    hasSameLemmas = areLemmasSame();
  }
public void leaveReading ( AnalyzedToken token ) { List < AnalyzedToken > l = new ArrayList < > ( ) ; AnalyzedToken tmpTok = new AnalyzedToken ( token . getToken ( ) , token . getPOSTag ( ) , token . getLemma ( ) ) ; tmpTok . setWhitespaceBefore ( isWhitespaceBefore ) ; for ( AnalyzedToken anTokReading : anTokReadings ) { if ( anTokReading . matches ( tmpTok ) ) { l . add ( anTokReading ) ; } } if ( l . isEmpty ( ) ) { l . add ( new AnalyzedToken ( this . token , null , null ) ) ; l . get ( 0 ) . setWhitespaceBefore ( isWhitespaceBefore ) ; } anTokReadings = l . toArray ( new AnalyzedToken [ 0 ] ) ; setNoRealPOStag ( ) ; hasSameLemmas = areLemmasSame ( ) ; }
Removes all readings but the one that matches the token given.
@param token Token to be matched
@since 1.5