@Override public TokenStream create(TokenStream input) { // if the fst is null, it means there's actually no synonyms... just return the original stream // as there is nothing to do here. return map.fst == null ? input : new SynonymGraphFilter(input, map, ignoreCase); }
@Override public TokenStream create(TokenStream tokenStream) { // fst is null means no synonyms return synonyms.fst == null ? tokenStream : new SynonymGraphFilter(tokenStream, synonyms, ignoreCase); } };
@Override public TokenStream create(TokenStream tokenStream) { // fst is null means no synonyms return synonymMap.fst == null ? tokenStream : new SynonymGraphFilter(tokenStream, synonymMap, ignoreCase); } }
@Override public TokenStream create(TokenStream tokenStream) { // fst is null means no synonyms return synonyms.fst == null ? tokenStream : new SynonymGraphFilter(tokenStream, synonyms, ignoreCase); } };
result = new SynonymGraphFilter(result, stemExceptions, true); result = new GermanStemmingFilter(result, hunspellDict, true, hyphen, true, wordlist, stemExceptions); result = new ReloadingSynonymGraphFilter(result, updateSynonymsService, true); } else { result = new SynonymGraphFilter(result, synonyms, true);
result = new SynonymGraphFilter(result, stemExceptions, true); result = new GermanStemmingFilter(result, hunspellDict, true, hyphen, true, wordlist, stemExceptions);
result = new SynonymGraphFilter(result, stemExceptions, true); result = new GermanStemmingFilter(result, hunspellDict, true, hyphen, true, wordlist, stemExceptions);
/** * Tries to stem the provided primary word using stemming exceptions. * * @param primaryWordTermAttr a {@link CharTermAttribute} containing the primary word * @return <tt>true</tt> if the primary word could be stemmed, <tt>false</tt> otherwise. * @throws IOException */ private boolean tryStemWithStemExceptions(CharTermAttribute primaryWordTermAttr) throws IOException { try (TokenStream stemExceptionsStream = new SynonymGraphFilter(new SingleTermTokenStream(primaryWordTermAttr.buffer(), primaryWordTermAttr.length()), this.stemExceptions, true)) { final CharTermAttribute stemExceptionTermAttr = stemExceptionsStream.addAttribute(CharTermAttribute.class); final TypeAttribute stemExceptionTypeAtt = stemExceptionsStream.addAttribute(TypeAttribute.class); stemExceptionsStream.reset(); stemExceptionsStream.incrementToken(); if (stemExceptionTermAttr.length() > 0 && SynonymGraphFilter.TYPE_SYNONYM.equals(stemExceptionTypeAtt.type())) { reAttachStemmedPrimaryWord(stemExceptionTermAttr.buffer(), stemExceptionTermAttr.length(), primaryWordTermAttr.length()); stemExceptionsStream.end(); return true; } stemExceptionsStream.end(); return false; } }
result = new SynonymGraphFilter(result, stemExceptions, true); result = new GermanStemmingFilter(result, hunspellDict, true, hyphen, true, wordlist, stemExceptions);
result = new SynonymGraphFilter(result, stemExceptions, true); result = new GermanStemmingFilter(result, hunspellDict, true, hyphen, true, wordlist, stemExceptions);