From a76c91501db9f408ce58eeba56e762dd506697c2 Mon Sep 17 00:00:00 2001 From: Mark Ma Date: Sat, 20 Jul 2019 14:41:47 +0800 Subject: [PATCH] add global declaration for start_P and trans_P (for improving symmetry, readability and syntax correctness) --- jieba/finalseg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jieba/finalseg/__init__.py b/jieba/finalseg/__init__.py index d7600f77..5a879634 100644 --- a/jieba/finalseg/__init__.py +++ b/jieba/finalseg/__init__.py @@ -57,7 +57,7 @@ def viterbi(obs, states, start_p, trans_p, emit_p): def __cut(sentence): - global emit_P + global emit_P, start_P, trans_P prob, pos_list = viterbi(sentence, 'BMES', start_P, trans_P, emit_P) begin, nexti = 0, 0 # print pos_list, sentence