Skip to content

Commit

Permalink
Fix a regression that mutScore is not correctly overridden. (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikiSuen authored May 25, 2022
1 parent ea14d9d commit ce283cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Megrez/4_Node.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ extension Megrez {
$0.score > $1.score
}

if mutUnigrams.count > 0 {
mutScore = mutUnigrams[0].score
}

for (i, gram) in mutUnigrams.enumerated() {
mutValueUnigramIndexMap[gram.keyValue.value] = i
mutCandidates.append(gram.keyValue)
Expand Down

0 comments on commit ce283cb

Please sign in to comment.