當前位置: 首頁>>代碼示例>>Java>>正文


Java CharArraySet.addAll方法代碼示例

本文整理匯總了Java中org.apache.lucene.analysis.util.CharArraySet.addAll方法的典型用法代碼示例。如果您正苦於以下問題:Java CharArraySet.addAll方法的具體用法?Java CharArraySet.addAll怎麽用?Java CharArraySet.addAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.lucene.analysis.util.CharArraySet的用法示例。


在下文中一共展示了CharArraySet.addAll方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: CapitalizationFilterFactory

import org.apache.lucene.analysis.util.CharArraySet; //導入方法依賴的package包/類
/** Creates a new CapitalizationFilterFactory */
public CapitalizationFilterFactory(Map<String, String> args) {
  super(args);
  assureMatchVersion();
  boolean ignoreCase = getBoolean(args, KEEP_IGNORE_CASE, false);
  Set<String> k = getSet(args, KEEP);
  if (k != null) {
    keep = new CharArraySet(10, ignoreCase);
    keep.addAll(k);
  }

  k = getSet(args, OK_PREFIX);
  if (k != null) {
    okPrefix = new ArrayList<>();
    for (String item : k) {
      okPrefix.add(item.toCharArray());
    }
  }

  minWordLength = getInt(args, MIN_WORD_LENGTH, 0);
  maxWordCount = getInt(args, MAX_WORD_COUNT, CapitalizationFilter.DEFAULT_MAX_WORD_COUNT);
  maxTokenLength = getInt(args, MAX_TOKEN_LENGTH, CapitalizationFilter.DEFAULT_MAX_TOKEN_LENGTH);
  onlyFirstWord = getBoolean(args, ONLY_FIRST_WORD, true);
  forceFirstLetter = getBoolean(args, FORCE_FIRST_LETTER, true);
  if (!args.isEmpty()) {
    throw new IllegalArgumentException("Unknown parameters: " + args);
  }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:29,代碼來源:CapitalizationFilterFactory.java

示例2: makeStopSet

import org.apache.lucene.analysis.util.CharArraySet; //導入方法依賴的package包/類
/**
 * @deprecated Use {@link #makeStopSet(String[],boolean)}
 */
@Deprecated
public static CharArraySet makeStopSet(Version matchVersion, String[] stopWords, boolean ignoreCase) {
  CharArraySet stopSet = new CharArraySet(matchVersion, stopWords.length, ignoreCase);
  stopSet.addAll(Arrays.asList(stopWords));
  return stopSet;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:StopFilter.java

示例3: resolveNamedWords

import org.apache.lucene.analysis.util.CharArraySet; //導入方法依賴的package包/類
private static CharArraySet resolveNamedWords(Collection<String> words, Map<String, Set<?>> namedWords, boolean ignoreCase) {
    if (namedWords == null) {
        return new CharArraySet(words, ignoreCase);
    }
    CharArraySet setWords = new CharArraySet(words.size(), ignoreCase);
    for (String word : words) {
        if (namedWords.containsKey(word)) {
            setWords.addAll(namedWords.get(word));
        } else {
            setWords.add(word);
        }
    }
    return setWords;
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:15,代碼來源:Analysis.java


注:本文中的org.apache.lucene.analysis.util.CharArraySet.addAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。