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

关于用pyim-article2dict-words函数生成词库文件 #46

Closed
et2010 opened this issue Jan 18, 2016 · 22 comments
Closed

关于用pyim-article2dict-words函数生成词库文件 #46

et2010 opened this issue Jan 18, 2016 · 22 comments

Comments

@et2010
Copy link
Contributor

et2010 commented Jan 18, 2016

我在网上找到了搜狗的核心词库,只有词没有拼音,想利用这个命令为词库文件添加拼音码但出了一点意外情况:

在我指定的空文件new.pyim里什么都没有,但是确实生成了分别以ConvertStage-xxxxxxx-CleanStage-xxxxxxx-开头的两个文件,其中Convert开头的文件包含拼音码。虽然也得到了词库,但是我想这个应该不是预期的行为。

@tumashu
Copy link
Owner

tumashu commented Jan 18, 2016

我记得应该有一个FinishXXX文件。。。

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

刚才只是用了一个比较小的文件试的,我又试了一个4M的文件,连Convert文件也是空白的了。没有Finish开头的文件

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

搜狗的核心词库文件:
pyim.txt

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

难道是因为词条太多?这个里面有459988行。怎么判断是否正在转换?我查看Convert文件一直都是空的

@tumashu
Copy link
Owner

tumashu commented Jan 18, 2016

我没在window上做过词库,估计是bug, 我下午看看

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

好的,谢谢!

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

一个小细节不知道有用没有:转换一个只有几十行的文件时,convert文件是有内容(词库文件)的,但是转换这个4m的文件时convert文件是空的

补充:又试了一下,这下怎么都出不来了,不管怎样都是空文件

@tumashu
Copy link
Owner

tumashu commented Jan 18, 2016

我发现问题了,你得到的词库里面有一些生僻字,比如; "" , Chinese-pyim 无法识别,所以在添加 pinyin 时出错

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

但是我只把前面几行用于生成词库也不行,不知道哪里出问题了

@tumashu
Copy link
Owner

tumashu commented Jan 18, 2016

那是因为window下没有evn和sort命令,我更新了一下,你再试试。。。。

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

我刚才用list-packages升级了pyim,但是问题依旧

@tumashu
Copy link
Owner

tumashu commented Jan 18, 2016

melpa 延迟 4 个小时 。。。

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

哦,sorry

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

我再试一下

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

试过了,还是不行。

而且,我试了把cygwin的bin目录通过添加环境变量的方式添加到exec-path中,这样Emacs也可以看到env和sort命令,但是问题依旧。

btw,我的杀毒软件确实检测到env被调用了,要我为env命令添加例外。

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

抱歉,刚才是我搞错了。现在可以出来了,但是仍然是没有finish文件,只有convert文件

@tumashu
Copy link
Owner

tumashu commented Jan 18, 2016

等更新吧,别折腾了。。。。

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

嗯嗯,不过已经不影响使用了,非常感谢!

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

只是转完了又多出来几万行是什么情况?

@tumashu
Copy link
Owner

tumashu commented Jan 18, 2016

你给我发邮件吧,我给你发一个我转的。。。github上传太慢了 tumashu @@@@@@@@ 163 ##### com

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

(∩_∩),好的,多谢!

@et2010
Copy link
Contributor Author

et2010 commented Jan 18, 2016

我最后又试了一下, fe4f5c8 确实解决了这个问题。

我用的spacemacs,所以是手动改的,刚才这个地方我为了测试cygwin下的sort可用与否,所以把它去掉了,结果证明cygwin的sort命令也不行。走了不少弯路,等pyim版本更新后就不存在这个问题了。

@et2010 et2010 closed this as completed Jan 19, 2016
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