NLPchina / ansj_seg

ansj分词.ict的真正java实现.分词效果速度都超过开源版的ict. 中文分词,人名识别,词性标注,用户自定义词典

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

仅输出分词结果?

lmobot opened this issue · comments

commented

使用过程中发现Analysis的实现类会输出分词+词性分词结果,如何仅输出分词结果,不显示词性?

可以看下Result分词结果类的方法

* 返回没有词性的切分结果
* @return
*/
public String toStringWithOutNature(){
return toStringWithOutNature(",");
}
/**
* 返回没有词性的切分结果
* @return
*/
public String toStringWithOutNature(String split) {

示例:

Result parse = ToAnalysis.parse(string);
System.out.println(parse.toStringWithOutNature());

输出:使用,了,它,就,可以,解决,一些,问题