private boolean containsOnlyInfinitivesToTheLeft(AnalyzedTokenReadings[] tokens, int startPos) throws IOException {
    int infinitives = 0;
    for (int i = startPos; i > 0; i--) {
      String token = tokens[i].getToken();
      if (tokens[i].hasPartialPosTag("SUB:")) {
        AnalyzedTokenReadings lookup = tagger.lookup(token.toLowerCase());
        if (lookup != null && lookup.hasPosTagStartingWith("VER:INF")) {
          infinitives++;
        } else {
          return false;
        }
      }
    }
    return infinitives >= 2;
  }
private boolean containsOnlyInfinitivesToTheLeft ( AnalyzedTokenReadings [ ] tokens , int startPos ) throws IOException { int infinitives = 0 ; for ( int i = startPos ; i > 0 ; i -- ) { String token = tokens [ i ] . getToken ( ) ; if ( tokens [ i ] . hasPartialPosTag ( "SUB:" ) ) { AnalyzedTokenReadings lookup = tagger . lookup ( token . toLowerCase ( ) ) ; if ( lookup != null && lookup . hasPosTagStartingWith ( "VER:INF" ) ) { infinitives ++ ; } else { return false ; } } } return infinitives >= 2 ; }
No false alarm on ""Das Kopieren und Einfügen ist sehr nützlich." etc.