本文整理汇总了Java中org.apache.lucene.analysis.compound.CompoundWordTokenFilterBase类的典型用法代码示例。如果您正苦于以下问题:Java CompoundWordTokenFilterBase类的具体用法?Java CompoundWordTokenFilterBase怎么用?Java CompoundWordTokenFilterBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CompoundWordTokenFilterBase类属于org.apache.lucene.analysis.compound包,在下文中一共展示了CompoundWordTokenFilterBase类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.apache.lucene.analysis.compound.CompoundWordTokenFilterBase; //导入依赖的package包/类
@Override
public void init(Map<String, String> args) {
super.init(args);
assureMatchVersion();
dictFile = args.get("dictionary");
if (args.containsKey("encoding"))
encoding = args.get("encoding");
hypFile = args.get("hyphenator");
if (null == hypFile) {
throw new IllegalArgumentException("Missing required parameter: hyphenator");
}
minWordSize = getInt("minWordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
minSubwordSize = getInt("minSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
maxSubwordSize = getInt("maxSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
onlyLongestMatch = getBoolean("onlyLongestMatch", false);
}
示例2: AbstractCompoundWordTokenFilterFactory
import org.apache.lucene.analysis.compound.CompoundWordTokenFilterBase; //导入依赖的package包/类
public AbstractCompoundWordTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
super(indexSettings, name, settings);
minWordSize = settings.getAsInt("min_word_size", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
minSubwordSize = settings.getAsInt("min_subword_size", CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
maxSubwordSize = settings.getAsInt("max_subword_size", CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
onlyLongestMatch = settings
.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "only_longest_match", false, deprecationLogger);
wordList = Analysis.getWordSet(env, indexSettings.getIndexVersionCreated(), settings, "word_list");
if (wordList == null) {
throw new IllegalArgumentException("word_list must be provided for [" + name + "], either as a path to a file, or directly");
}
}
示例3: AbstractCompoundWordTokenFilterFactory
import org.apache.lucene.analysis.compound.CompoundWordTokenFilterBase; //导入依赖的package包/类
public AbstractCompoundWordTokenFilterFactory(Index index, Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
super(index, indexSettings, name, settings);
minWordSize = settings.getAsInt("min_word_size", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
minSubwordSize = settings.getAsInt("min_subword_size", CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
maxSubwordSize = settings.getAsInt("max_subword_size", CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
onlyLongestMatch = settings.getAsBoolean("only_longest_match", false);
wordList = Analysis.getWordSet(env, settings, "word_list");
if (wordList == null) {
throw new IllegalArgumentException("word_list must be provided for [" + name + "], either as a path to a file, or directly");
}
}