当前位置: 首页>>代码示例>>Java>>正文


Java CharArraySet.EMPTY_SET属性代码示例

本文整理汇总了Java中org.apache.lucene.analysis.CharArraySet.EMPTY_SET属性的典型用法代码示例。如果您正苦于以下问题:Java CharArraySet.EMPTY_SET属性的具体用法?Java CharArraySet.EMPTY_SET怎么用?Java CharArraySet.EMPTY_SET使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.lucene.analysis.CharArraySet的用法示例。


在下文中一共展示了CharArraySet.EMPTY_SET属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PatternAnalyzerProvider

public PatternAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);

    final CharArraySet defaultStopwords = CharArraySet.EMPTY_SET;
    boolean lowercase =
        settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "lowercase", true, deprecationLogger);
    CharArraySet stopWords = Analysis.parseStopWords(env, indexSettings.getIndexVersionCreated(), settings, defaultStopwords);

    String sPattern = settings.get("pattern", "\\W+" /*PatternAnalyzer.NON_WORD_PATTERN*/);
    if (sPattern == null) {
        throw new IllegalArgumentException("Analyzer [" + name + "] of type pattern must have a `pattern` set");
    }
    Pattern pattern = Regex.compile(sPattern, settings.get("flags"));

    analyzer = new PatternAnalyzer(pattern, lowercase, stopWords);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:PatternAnalyzerProvider.java

示例2: parseStemExclusion

public static CharArraySet parseStemExclusion(Settings settings, CharArraySet defaultStemExclusion) {
    String value = settings.get("stem_exclusion");
    if (value != null) {
        if ("_none_".equals(value)) {
            return CharArraySet.EMPTY_SET;
        } else {
            // LUCENE 4 UPGRADE: Should be settings.getAsBoolean("stem_exclusion_case", false)?
            return new CharArraySet(Strings.commaDelimitedListToSet(value), false);
        }
    }
    String[] stemExclusion = settings.getAsArray("stem_exclusion", null);
    if (stemExclusion != null) {
        // LUCENE 4 UPGRADE: Should be settings.getAsBoolean("stem_exclusion_case", false)?
        return new CharArraySet(Arrays.asList(stemExclusion), false);
    } else {
        return defaultStemExclusion;
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:Analysis.java

示例3: parseWords

public static CharArraySet parseWords(Environment env, Settings settings, String name, CharArraySet defaultWords,
                                      Map<String, Set<?>> namedWords, boolean ignoreCase) {
    String value = settings.get(name);
    if (value != null) {
        if ("_none_".equals(value)) {
            return CharArraySet.EMPTY_SET;
        } else {
            return resolveNamedWords(Strings.commaDelimitedListToSet(value), namedWords, ignoreCase);
        }
    }
    List<String> pathLoadedWords = getWordList(env, settings, name);
    if (pathLoadedWords != null) {
        return resolveNamedWords(pathLoadedWords, namedWords, ignoreCase);
    }
    return defaultWords;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:Analysis.java

示例4: StandardHtmlStripAnalyzerProvider

public StandardHtmlStripAnalyzerProvider(IndexSettings indexSettings, Environment env,  String name, Settings settings) {
    super(indexSettings, name, settings);
    final CharArraySet defaultStopwords = CharArraySet.EMPTY_SET;
    CharArraySet stopWords = Analysis.parseStopWords(env, indexSettings.getIndexVersionCreated(), settings, defaultStopwords);
    analyzer = new StandardHtmlStripAnalyzer(stopWords);
    analyzer.setVersion(version);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:StandardHtmlStripAnalyzerProvider.java

示例5: StandardAnalyzerProvider

public StandardAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    final CharArraySet defaultStopwords = CharArraySet.EMPTY_SET;
    CharArraySet stopWords = Analysis.parseStopWords(env, indexSettings.getIndexVersionCreated(), settings, defaultStopwords);
    int maxTokenLength = settings.getAsInt("max_token_length", StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH);
    standardAnalyzer = new StandardAnalyzer(stopWords);
    standardAnalyzer.setVersion(version);
    standardAnalyzer.setMaxTokenLength(maxTokenLength);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:StandardAnalyzerProvider.java

示例6: testReusableTokenStream

public void testReusableTokenStream() throws Exception {
    Analyzer a = new FingerprintAnalyzer(CharArraySet.EMPTY_SET, ' ', 255);
    assertAnalyzesTo(a, "foo bar baz Baz foo foo FOO. FoO",
        new String[]{"bar baz foo"});
    assertAnalyzesTo(a, "xyz XYZ abc 123.2 abc",
        new String[]{"123.2 abc xyz"});
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:FingerprintAnalyzerTests.java

示例7: testAsciifolding

public void testAsciifolding() throws Exception {
    Analyzer a = new FingerprintAnalyzer(CharArraySet.EMPTY_SET, ' ', 255);
    assertAnalyzesTo(a, "gödel escher bach",
        new String[]{"bach escher godel"});

    assertAnalyzesTo(a, "gödel godel escher bach",
        new String[]{"bach escher godel"});
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:FingerprintAnalyzerTests.java

示例8: testLimit

public void testLimit() throws Exception {
    Analyzer a = new FingerprintAnalyzer(CharArraySet.EMPTY_SET, ' ', 3);
    assertAnalyzesTo(a, "e d c b a",
        new String[]{});

    assertAnalyzesTo(a, "b a",
        new String[]{"a b"});
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:FingerprintAnalyzerTests.java

示例9: withDefaultAnalyzer

public void withDefaultAnalyzer() {
    if (this.customAnalyzerWrapperFactory == null) {
        this.analyzer = new KiePerFieldAnalyzerWrapper(new StandardAnalyzer(CharArraySet.EMPTY_SET),
                                                       new HashMap<String, Analyzer>() {{
                                                           putAll(analyzers);
                                                       }});
    } else {
        this.analyzer = this.customAnalyzerWrapperFactory.getAnalyzerWrapper(new StandardAnalyzer(CharArraySet.EMPTY_SET),
                                                                             analyzers);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:11,代码来源:MetadataConfigBuilder.java

示例10: AnsjIndexAnalyzer

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));
}
 
开发者ID:flash0729,项目名称:ansj-seg-for-lucene3,代码行数:7,代码来源:AnsjIndexAnalyzer.java

示例11: AnsjAnalyzer

/**
    * @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));
}
 
开发者ID:flash0729,项目名称:ansj-seg-for-lucene3,代码行数:11,代码来源:AnsjAnalyzer.java

示例12: AnsjSearchAnalyzer

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));
}
 
开发者ID:flash0729,项目名称:ansj-seg-for-lucene3,代码行数:7,代码来源:AnsjSearchAnalyzer.java

示例13: testFingerprint

public void testFingerprint() throws Exception {
    Analyzer a = new FingerprintAnalyzer(CharArraySet.EMPTY_SET, ' ', 255);
    assertAnalyzesTo(a, "foo [email protected] Baz $ foo foo FOO. FoO",
        new String[]{"bar baz foo"});
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:FingerprintAnalyzerTests.java

示例14: GosenAnalyzer

/**
 * Create a GosenAnalyzer with default parameter values
 */
public GosenAnalyzer() {
  this(DefaultSetHolder.DEFAULT_STOP_SET, DefaultSetHolder.DEFAULT_STOP_TAGS, CharArraySet.EMPTY_SET, null, DEFAULT_UNKNOWN_KATAKANA_TOKENIZATION);
}
 
开发者ID:lucene-gosen,项目名称:lucene-gosen,代码行数:6,代码来源:GosenAnalyzer.java


注:本文中的org.apache.lucene.analysis.CharArraySet.EMPTY_SET属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。