看过了许多分词包,IK无需使用Lucene可实现分词,较为简单实用。
阅读(407) | 评论(0) | 转发(0) |
<script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=3&lang=zh"></script> <script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/bshareC0.js"></script>
点击(此处)折叠或打开
- public void setfre(String string){
-
- StringReader reader = new StringReader(string);
- IKSegmenter ik = new IKSegmenter(reader,true);//后一个变量决定是否消歧
-
- Lexeme lexeme = null;
- float count=0;
- try {
- while((lexeme = ik.next())!=null) {
- String word=lexeme.getLexemeText();
- count++;
- if (!this.wordfre.containsKey(word)) {
- this.wordfre.put(word, 1);
- }else {
- same++;
- this.wordfre.put(word, this.wordfre.get(word)+1);
- }
-
- }
- }
相关热门文章
- 开网店若何研讨敌手竞争策略_...
- 华美远航(北京)投资有限公司...
- 树形半封闭代码表中的“其他”...
- IT行业人才供不应求,投身IT行...
- http://chuz.baoxianzp.com 滁...
给主人留下些什么吧!~~
评论热议