tumashu / chinese-yasdcv

一个简单的sdcv字典程序的emacs前端。
27 stars 3 forks source link

Support 结巴中文分词 and better Chinese word predication #3

Closed xuchunyang closed 9 years ago

xuchunyang commented 9 years ago

After this two commit, 结巴中文分词 is used by default, we should provide a custom option for user to choose which one will be used, so this PR is still work in process, don't merge for now.

xuchunyang commented 9 years ago

@tumashu 让用户选择分词工具,有3个选择:scws、结巴和不考虑中文分词,应该用什么数据类型?

tumashu commented 9 years ago

defcustom那我也不太懂,我的意见是: 默认使用结巴,其他的方法在变量文档里说明用法。 因为scws还没有进入许多发行版,需要自己编译,比较麻烦。

另外,如果上面的补丁不需要做大的改动(defcustom那一块暂时不用考虑),我就merge了。

tumashu commented 9 years ago

我个人感觉,我们只需要提供一个yasdcv-chinese-wordsplit-command变量,然后在这个变量文档 中较为详细的介绍上述三种设置,就可以了。。。不必要再分scws,jieba了。

xuchunyang commented 9 years ago

我个人感觉,我们只需要提供一个yasdcv-chinese-wordsplit-command变量,然后在这个变量文档 中较为详细的介绍上述三种设置,就可以了。。。不必要再分scws,jieba了。

也好,直接在文档里写好这 2种可能的选项,用 string 类型,空字符串(“”)表示不用分词工具,其余则是 scws 或 jieba。

估计等一小会,就能把这个实现。你再测试(使用)一下,之后再合并。

xuchunyang commented 9 years ago

@tumashu 已经完成了。

tumashu commented 9 years ago

我感觉 “什么也不用” 应该将其设置成 nil ,然后命令调用之前,检查是否为 nil

tumashu commented 9 years ago

另外,最好在文档里,简要的介绍一下各个分词程序,如果有必要,将分词程序文档链接加进去也可以。

xuchunyang commented 9 years ago

我感觉 “什么也不用” 应该将其设置成 nil ,然后命令调用之前,检查是否为 nil

我一开始也想直接用 nil 的,但是 nil 似乎没法在 Customization 界面设置,留空的话结果是 "",而不是 nil。

tumashu commented 9 years ago

先merge吧,再慢慢调整。。。。

xuchunyang commented 9 years ago

我感觉 “什么也不用” 应该将其设置成 nil ,然后命令调用之前,检查是否为 nil

用户把yasdcv-chinese-wordsplit-command设置成nil""效果相同,因为(length "")(length nil) 的结果都是0,

PS. 判断“什么也不用”的代码在:https://github.com/tumashu/chinese-yasdcv/blob/master/chinese-yasdcv.el#L206