资源简介

Lucene提取新闻关键词Top-N JDK版本要求1.7,lucene版本要求5.5.3 使用说明: 1、在IndexDocs.java右键run as java application 2、在GetTopTerms.java右键run as java application

资源截图

代码片段和文件信息

package lucene.ik;

import java.io.Reader;
import java.io.StringReader;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.util.IOUtils;

public class IkAnalyzer6x extends Analyzer {

    @Override
    protected TokenStreamComponents createComponents(String arg0) {
        Reader reader=null;
        try{
            reader=new StringReader(arg0);
            IKTokenizer6x it = new IKTokenizer6x(reader);
            return new Analyzer.TokenStreamComponents(it);
        }finally {
            IOUtils.closeWhileHandlingException(reader);
        }
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-05-10 11:18  lucene\
     文件         788  2018-05-09 17:52  lucene\.classpath
     文件         382  2018-05-08 16:11  lucene\.project
     目录           0  2018-05-10 11:12  lucene\.settings\
     文件         120  2018-05-10 11:13  lucene\.settings\org.eclipse.core.resources.prefs
     目录           0  2018-09-07 15:59  lucene\bin\
     文件         414  2018-05-10 10:31  lucene\bin\IKAnalyzer.cfg.xml
     目录           0  2018-09-07 15:59  lucene\bin\lucene\
     目录           0  2018-09-07 15:59  lucene\bin\lucene\ik\
     文件        2556  2018-09-07 15:59  lucene\bin\lucene\ik\IKTokenizer6x.class
     文件        1208  2018-09-07 15:59  lucene\bin\lucene\ik\IkAnalyzer6x.class
     目录           0  2018-09-07 15:59  lucene\bin\lucene\test\
     文件        1277  2018-09-07 15:59  lucene\bin\lucene\test\GetTopTerms$1.class
     文件        3543  2018-09-07 15:59  lucene\bin\lucene\test\GetTopTerms.class
     文件        3689  2018-09-07 15:59  lucene\bin\lucene\test\IndexDocs.class
     文件        5461  2018-05-10 11:16  lucene\bin\stopword.dic
     目录           0  2018-09-07 16:00  lucene\indexdir\
     文件         373  2018-09-07 16:00  lucene\indexdir\_r.cfe
     文件       49843  2018-09-07 16:00  lucene\indexdir\_r.cfs
     文件         359  2018-09-07 16:00  lucene\indexdir\_r.si
     文件         136  2018-09-07 16:00  lucene\indexdir\segments_s
     文件           0  2018-05-09 17:52  lucene\indexdir\write.lock
     目录           0  2018-05-09 17:52  lucene\lib\
     文件     1165347  2018-05-08 17:44  lucene\lib\IKAnalyzer2012_u6.jar
     文件     1576969  2018-05-09 17:50  lucene\lib\lucene-analyzers-common-5.5.3.jar
     文件     3603440  2018-05-09 17:50  lucene\lib\lucene-analyzers-smartcn-5.5.3.jar
     文件     2371553  2018-05-09 17:51  lucene\lib\lucene-core-5.5.3.jar
     文件      144817  2018-05-09 17:51  lucene\lib\lucene-highlighter-5.5.3.jar
     文件       33804  2018-05-09 17:51  lucene\lib\lucene-memory-5.5.3.jar
     文件      251571  2018-05-09 17:51  lucene\lib\lucene-queries-5.5.3.jar
     文件      402732  2018-05-09 17:51  lucene\lib\lucene-queryparser-5.5.3.jar
............此处省略13个文件信息

评论

共有 条评论