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

我同时想要词性标注和自定义词典有没办法做到的? #36

Closed
minren118 opened this issue Apr 5, 2018 · 1 comment
Closed

Comments

@minren118
Copy link

minren118 commented Apr 5, 2018

看到词性标注和自定义词典里用的不是同一个实例,不知道是因为.net版没有实现还是原版结巴就没有的?
var posSeg = new PosSegmenter(); var s = "一团硕大无朋的高能离子云,在遥远而神秘的太空中迅疾地飘移"; var tokens = posSeg.Cut(s); Console.WriteLine(string.Join(" ", tokens.Select(token => string.Format("{0}/{1}", token.Word, token.Flag))));

JiebaSegmenter.AddWord(word, freq=0, tag=null)

@minren118
Copy link
Author

minren118 commented Apr 5, 2018

看回源代码,原来可以传入一个JiebaSegmenter 给PosSegmenter构造函数,是自己没看懂,问了个无知问题
public PosSegmenter() { _segmenter = new JiebaSegmenter(); }
public PosSegmenter(JiebaSegmenter segmenter) { _segmenter = segmenter; }

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