1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-05 00:32:51 +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 {
if pss[i].Prob == pss[j].Prob {
if pss[i].ST.Tag < pss[j].ST.Tag {
return true
} else if pss[i].ST.State < pss[j].ST.State {
return true
} else {
return false
if pss[i].ST.State == pss[j].ST.State {
return pss[i].ST.Tag < pss[j].ST.Tag
}
return pss[i].ST.State < pss[j].ST.State
}
return pss[i].Prob < pss[j].Prob
}