开放细胞词库构建工具

13 views
Skip to first unread message

twinsant

unread,
Jun 18, 2009, 5:56:56 AM6/18/09
to 句读:开放的中文分词项目
开放细胞词库的词典构建工具,现在回头看当初写的代码,真是惨不忍睹啊。。。举例来说,有的地方用print、有的用logging、有的用自己封装的logger。。。
http://code.google.com/p/judou/source/detail?r=17

所以说,同学们,我这么烂的代码都敢公开,你们还害怕什么,有什么好代码,就放上来吧!

主要文件
memcachedb.py
judou_dict.py
freq_helper.py
logger.py
pinyin.py

依赖memcachedb,请自行构建。

主要功能是:
1、从下载的txt细胞词库文件抽取词构建sqlite数据库
2、用搜索引擎查询词出现的频次

在蚂蚁的R60上构建时间
2009-06-18 17:42:38,251 INFO Done! Elapsed time 3:18:19.657159

一些基本信息:
sqlite> .schema dictionary
CREATE TABLE dictionary (id integer primary key autoincrement, keyword text unique, length integer, leading, ending text, pinyin text, keyword_index text, freq integer, flag integer);

sqlite> select count(*) from dictionary;
4132207

twinsant

unread,
Jun 18, 2009, 8:42:56 PM6/18/09
to 句读:开放的中文分词项目
Reply all
Reply to author
Forward
0 new messages