本文整理匯總了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);
}
}
示例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;
}
示例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;
}