当前位置: 首页>>代码示例>>Java>>正文


Java CompoundWordTokenFilterBase类代码示例

本文整理汇总了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);
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:18,代码来源:HyphenationCompoundWordTokenFilterFactory.java

示例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");
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:AbstractCompoundWordTokenFilterFactory.java

示例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");
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:AbstractCompoundWordTokenFilterFactory.java


注:本文中的org.apache.lucene.analysis.compound.CompoundWordTokenFilterBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。