Example usage for org.apache.lucene.analysis.cn.smart SmartChineseAnalyzer getDefaultStopSet

List of usage examples for org.apache.lucene.analysis.cn.smart SmartChineseAnalyzer getDefaultStopSet

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.cn.smart SmartChineseAnalyzer getDefaultStopSet.

Prototype

public static CharArraySet getDefaultStopSet() 

Source Link

Document

Returns an unmodifiable instance of the default stop-words set.

Usage

From source file:hivemall.nlp.tokenizer.SmartcnUDF.java

License:Apache License

@Nonnull
private static CharArraySet stopWords(@Nullable final String[] array) throws UDFArgumentException {
    if (array == null) {
        return SmartChineseAnalyzer.getDefaultStopSet();
    }/*from  w  ww .j av a  2  s. c  o  m*/
    if (array.length == 0) {
        return CharArraySet.EMPTY_SET;
    }
    CharArraySet results = new CharArraySet(Arrays.asList(array), true /* ignoreCase */);
    return results;
}

From source file:org.elasticsearch.index.analysis.SmartChineseAnalyzerProvider.java

License:Apache License

@Inject
public SmartChineseAnalyzerProvider(Index index, IndexSettingsService indexSettingsService, Environment env,
        @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);

    analyzer = new SmartChineseAnalyzer(SmartChineseAnalyzer.getDefaultStopSet());
}