Examples of SmartChineseAnalyzer


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

    }
    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

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

    @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

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

    @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
Copyright © 2018 www.massapi.com. 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.