Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fxsjy committed Apr 27, 2013
1 parent 9e4fce6 commit da63585
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')

分词速度
=========
Expand Down Expand Up @@ -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
=========
Expand Down

0 comments on commit da63585

Please sign in to comment.