當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。