Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

仅输出分词结果? #782

Open
lmobot opened this issue Dec 13, 2020 · 1 comment
Open

仅输出分词结果? #782

lmobot opened this issue Dec 13, 2020 · 1 comment

Comments

@lmobot
Copy link

lmobot commented Dec 13, 2020

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

@Alanscut
Copy link
Contributor

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

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

示例:

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants