本文整理匯總了Java中org.apache.lucene.analysis.miscellaneous.KeepWordFilter類的典型用法代碼示例。如果您正苦於以下問題:Java KeepWordFilter類的具體用法?Java KeepWordFilter怎麽用?Java KeepWordFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
KeepWordFilter類屬於org.apache.lucene.analysis.miscellaneous包,在下文中一共展示了KeepWordFilter類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: create
import org.apache.lucene.analysis.miscellaneous.KeepWordFilter; //導入依賴的package包/類
@Override
public TokenStream create(TokenStream tokenStream) {
if (version.onOrAfter(Version.LUCENE_4_4)) {
return new KeepWordFilter(tokenStream, keepWords);
} else {
@SuppressWarnings("deprecation")
final TokenStream filter = new Lucene43KeepWordFilter(enablePositionIncrements, tokenStream, keepWords);
return filter;
}
}
示例2: create
import org.apache.lucene.analysis.miscellaneous.KeepWordFilter; //導入依賴的package包/類
@Override
public TokenStream create(TokenStream tokenStream) {
return new KeepWordFilter(tokenStream, keepWords);
}
示例3: create
import org.apache.lucene.analysis.miscellaneous.KeepWordFilter; //導入依賴的package包/類
@Override
public TokenStream create(TokenStream input) {
// if the set is null, it means it was empty
return words == null ? input : new KeepWordFilter(enablePositionIncrements, input, words);
}