1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-07-02 10:00:27 +08:00

fixed the bug cause random testing failure, the Less() function was wrong

This commit is contained in:
Wang Bin
2014-08-11 16:44:26 +08:00
parent bd12e7682d
commit b51ae37771

View File

@@ -37,13 +37,10 @@ func (pss ProbStates) Len() int {
func (pss ProbStates) Less(i, j int) bool { func (pss ProbStates) Less(i, j int) bool {
if pss[i].Prob == pss[j].Prob { if pss[i].Prob == pss[j].Prob {
if pss[i].ST.Tag < pss[j].ST.Tag { if pss[i].ST.State == pss[j].ST.State {
return true return pss[i].ST.Tag < pss[j].ST.Tag
} else if pss[i].ST.State < pss[j].ST.State {
return true
} else {
return false
} }
return pss[i].ST.State < pss[j].ST.State
} }
return pss[i].Prob < pss[j].Prob return pss[i].Prob < pss[j].Prob
} }