Skip to content

Commit

Permalink
Merge pull request #21 from nxtk/main
Browse files Browse the repository at this point in the history
Fix for scoring issues caused by incorrect multi-byte character indexing.
  • Loading branch information
semilin authored May 2, 2024
2 parents 54f1bf4 + 5c114f5 commit eb03f72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ func FastTrigrams(l *Layout, precision int) TrigramValues {
}

for _, tg := range Data.TopTrigrams[:min(len(Data.TopTrigrams), precision)] {
km1, ok1 := l.Keymap[string(tg.Ngram[0])]
km2, ok2 := l.Keymap[string(tg.Ngram[1])]
km3, ok3 := l.Keymap[string(tg.Ngram[2])]
km1, ok1 := l.Keymap[string([]rune(tg.Ngram)[0])]
km2, ok2 := l.Keymap[string([]rune(tg.Ngram)[1])]
km3, ok3 := l.Keymap[string([]rune(tg.Ngram)[2])]

if !ok1 || !ok2 || !ok3 {
continue
Expand Down

0 comments on commit eb03f72

Please sign in to comment.