本文整理汇总了Java中org.apache.lucene.analysis.CharArraySet.unmodifiableSet方法的典型用法代码示例。如果您正苦于以下问题:Java CharArraySet.unmodifiableSet方法的具体用法?Java CharArraySet.unmodifiableSet怎么用?Java CharArraySet.unmodifiableSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.analysis.CharArraySet
的用法示例。
在下文中一共展示了CharArraySet.unmodifiableSet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStopWordList
import org.apache.lucene.analysis.CharArraySet; //导入方法依赖的package包/类
public static CharArraySet getStopWordList(Version luceneVersion, String stopwordList, boolean ignoreCase) {
String[] terms = stopwordList.split(",");
CharArraySet stopwordSet = new CharArraySet(luceneVersion, terms.length, ignoreCase);
for (String term : terms) {
stopwordSet.add(term);
}
return CharArraySet.unmodifiableSet(stopwordSet);
}
示例2: AnsjIndexAnalyzer
import org.apache.lucene.analysis.CharArraySet; //导入方法依赖的package包/类
public AnsjIndexAnalyzer(final Version matchVersion, final Set<?> stopwords) {
super();
this.matchVersion = matchVersion;
// analyzers should use char array set for stopwords!
this.stopwords = stopwords == null ? CharArraySet.EMPTY_SET : CharArraySet
.unmodifiableSet(CharArraySet.copy(matchVersion, stopwords));
}
示例3: AnsjAnalyzer
import org.apache.lucene.analysis.CharArraySet; //导入方法依赖的package包/类
/**
* @param analysis
* 搜索时用精准分词,索引时用面向索引的分词,默认值为面向索引的分词
*/
public AnsjAnalyzer(final Version matchVersion, Class<? extends Analysis> analysis, final Set<?> stopwords) {
this.matchVersion = matchVersion;
this.analysis = analysis == null ? IndexAnalysis.class : analysis;
// analyzers should use char array set for stopwords!
this.stopwords = stopwords == null ? CharArraySet.EMPTY_SET : CharArraySet
.unmodifiableSet(CharArraySet.copy(matchVersion, stopwords));
}
示例4: AnsjSearchAnalyzer
import org.apache.lucene.analysis.CharArraySet; //导入方法依赖的package包/类
public AnsjSearchAnalyzer(final Version matchVersion, final Set<?> stopwords) {
super();
this.matchVersion = matchVersion;
// analyzers should use char array set for stopwords!
this.stopwords = stopwords == null ? CharArraySet.EMPTY_SET : CharArraySet
.unmodifiableSet(CharArraySet.copy(matchVersion, stopwords));
}
示例5: SnowballAnalyzer
import org.apache.lucene.analysis.CharArraySet; //导入方法依赖的package包/类
/** Builds the named analyzer with the given stop words. */
public SnowballAnalyzer(String name, CharArraySet stopWords) {
this(name);
stopSet = CharArraySet.unmodifiableSet(CharArraySet.copy(stopWords));
}