Package org.apache.lucene.analysis.cn.smart

Examples of org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer$DefaultSetHolder


    }
    System.out.println("Length = " + testString.length() + "  | " +testString.getBytes().length);
   
    StringReader reader = new StringReader(testString);
   
    SmartChineseAnalyzer ss = new SmartChineseAnalyzer(Version.LUCENE_30)
   
   
    try {
      Thread.sleep(5000);
    } catch (InterruptedException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
   
    long begin = System.currentTimeMillis();  
   
    TokenStream tokenStream = ss.tokenStream("", reader);
    try {
      while(tokenStream.incrementToken()){
//        TermAttribute termAttribute = tokenStream.getAttribute(TermAttribute.class);
//        System.out.println(termAttribute.toString());
       
View Full Code Here


    @Inject
    public SmartChineseAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
        super(index, indexSettings, name, settings);

        analyzer = new SmartChineseAnalyzer(SmartChineseAnalyzer.getDefaultStopSet());
    }
View Full Code Here

    @Inject
    public SmartChineseIndicesAnalysis(Settings settings, IndicesAnalysisService indicesAnalysisService) {
        super(settings);

        // Register smartcn analyzer
        indicesAnalysisService.analyzerProviderFactories().put("smartcn", new PreBuiltAnalyzerProviderFactory("smartcn", AnalyzerScope.INDICES, new SmartChineseAnalyzer()));

        // Register smartcn_tokenizer tokenizer
        indicesAnalysisService.tokenizerFactories().put("smartcn_tokenizer", new PreBuiltTokenizerFactoryFactory(new TokenizerFactory() {
            @Override
            public String name() {
View Full Code Here

TOP

Related Classes of org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer$DefaultSetHolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.