mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
log(1)==0, since we have changed from PRODUCT to sum of LOG
This commit is contained in:
parent
c350fab2b9
commit
47d94a13e6
@ -87,7 +87,7 @@ def __cut_all(sentence):
|
||||
|
||||
def calc(sentence,DAG,idx,route):
|
||||
N = len(sentence)
|
||||
route[N] = (1.0,'')
|
||||
route[N] = (0.0,'')
|
||||
for idx in xrange(N-1,-1,-1):
|
||||
candidates = [ ( FREQ.get(sentence[idx:x+1],min_freq) + route[x+1][0],x ) for x in DAG[idx] ]
|
||||
route[idx] = max(candidates)
|
||||
|
Loading…
x
Reference in New Issue
Block a user