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

WordDictionary LoadDict Invalid line #13

Open
tangjialang opened this issue Aug 15, 2024 · 0 comments
Open

WordDictionary LoadDict Invalid line #13

tangjialang opened this issue Aug 15, 2024 · 0 comments

Comments

@tangjialang
Copy link

我在jieba文档上看到自定义词典的时候:词典格式和 dict.txt 一样,一个词占一行;每一行分三部分:词语、词频(可省略)、词性(可省略),用空格隔开,顺序不可颠倒。
但是我现在只有词语这时候就会导致WordDictionary在LoadDict的时候进行var tokens = line.Split(' ');的时候出现问题
if (tokens.Length < 2)
{
Debug.Fail(string.Format("Invalid line: {0}", line));
continue;
}
我尝试看了很多版本的jieba他们似乎没有这个问题并且兼容了:词语、词频(可省略)、词性(可省略)我不太清楚目前是无法做到还是因为写错了

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

1 participant