mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
Update README.md
This commit is contained in:
parent
9e4fce6b68
commit
da635859d4
15
README.md
15
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
|
||||
=========
|
||||
|
Loading…
x
Reference in New Issue
Block a user