本文整理汇总了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;
}