code: private boolean isTokenInSentence(AnalyzedTokenReadings testToken, AnalyzedTokenReadings[] tokens, int notCheck) {
      if (testToken == null || tokens == null) {
        return false;
      }
      List<AnalyzedToken> readings = testToken.getReadings();
      List<String> lemmas = new ArrayList<>();
      for (AnalyzedToken reading : readings) {
        if (reading.getLemma() != null) {
          lemmas.add(reading.getLemma());
        }
      }
      for (int i = 0; i < tokens.length; i++) {
        if (i != notCheck && isTokenToCheck(tokens[i])) {
          if ((!lemmas.isEmpty() && tokens[i].hasAnyLemma(lemmas.toArray(new String[0]))) 
              || isPartOfWord(testToken.getToken(), tokens[i].getToken())) {
            if (notCheck >= 0) {
              if (notCheck == i - 2) {
                return !isTokenPair(tokens, i, true);
              } else if (notCheck == i + 2) {
                return !isTokenPair(tokens, i, false);
              } else if ((notCheck == i + 1 || notCheck == i - 1) 
                  && testToken.getToken().equals(tokens[i].getToken())) {
                return false;
              }
            }
            return true;
          }
        }
      }
      return false;
    }
docs: /*
  true if token is found in sentence