Java 类org.apache.lucene.analysis.th.ThaiAnalyzer 实例源码

项目:langpi    文件:ThSWEliminator.java   
private static List<String> getStopList(String path) {

List<String> stopwords = new ArrayList<String>();
   try {
    //Get the stopwords from Apache Thai Analyzer Jar
    InputStream in = ThaiAnalyzer.class.getResourceAsStream(path);
    BufferedReader input = new BufferedReader(
                new InputStreamReader(in));
     for(String line = input.readLine(); line != null; line = input.readLine()) {
      if (line.startsWith("#")) continue;
      stopwords.add(line);
     }
     input.close();

     return stopwords;

   } catch(IOException e) {
     e.printStackTrace();
     System.exit(1);
     return null;
   } 
 }
项目:elasticsearch_my    文件:ThaiAnalyzerProvider.java   
public ThaiAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    analyzer = new ThaiAnalyzer(
        Analysis.parseStopWords(env, indexSettings.getIndexVersionCreated(), settings, ThaiAnalyzer.getDefaultStopSet()));
    analyzer.setVersion(version);
}
项目:elasticsearch_my    文件:ThaiAnalyzerProvider.java   
@Override
public ThaiAnalyzer get() {
    return this.analyzer;
}
项目:Elasticsearch    文件:ThaiAnalyzerProvider.java   
@Inject
public ThaiAnalyzerProvider(Index index, IndexSettingsService indexSettingsService, Environment env, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);
    analyzer = new ThaiAnalyzer(Analysis.parseStopWords(env, settings, ThaiAnalyzer.getDefaultStopSet()));
    analyzer.setVersion(version);
}
项目:Elasticsearch    文件:ThaiAnalyzerProvider.java   
@Override
public ThaiAnalyzer get() {
    return this.analyzer;
}