From da635859d4249fb819ecead0e68e89212c773415 Mon Sep 17 00:00:00 2001 From: Sun Junyi Date: Sat, 27 Apr 2013 10:56:10 +0800 Subject: [PATCH] Update README.md --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7a0cb7b..a748cca 100644 --- a/README.md +++ b/README.md @@ -146,11 +146,14 @@ https://github.com/fxsjy/jieba/raw/master/extra_dict/dict.txt.big 默认情况下,jieba采用延迟加载,一旦有必要建立trie。这需要1-3秒一次而以,之后还没有重新初始化。如果你想手工初始jieba,您可以用: import jieba - jieba.initialize() + jieba.initialize() #手动初始化(可选) -在这一步还可以指定要使用的词典(可选): +在0.28之前的版本是不能指定主词典的路径的,有了延迟加载机制后,你可以改变主词典的路径: + + jieba.set_dictionary('data/dict.txt.big') + +例子: https://github.com/fxsjy/jieba/blob/master/test/test_change_dictpath.py - jieba.initialize('data/dict.txt.big') 分词速度 ========= @@ -276,11 +279,11 @@ Initialization By default, Jieba employs lazy loading to only build the trie once it is necessary. This takes 1-3 seconds once, after which it is not initialized again. If you want to initialize Jieba manually, you can call: import jieba - jieba.initialize() + jieba.initialize() #(optional) -You can also specify the dictionary to use in this step (optional): +You can also specify the dictionary (not supported before version 0.28) : - jieba.initialize('data/dict.txt.big') + jieba.set_dictionary('data/dict.txt.big') Segmentation speed =========