Skip to content

Commit

Permalink
Reorder candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
ensan-hcl committed Sep 19, 2023
1 parent 920e377 commit c97dd9c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ import SwiftUtils
}
emojiCandidates = self.getUniquePredictionCandidate(emojiCandidates, seenCandidates: seenCandidates)

return zeroHintResults.chained(predictionResults).chained(emojiCandidates.suffix(3)).max(count: 10, sortedBy: {$0.value < $1.value})
var results: [PredictionCandidate] = []
results.append(contentsOf: emojiCandidates.suffix(3))
results.append(contentsOf: predictionResults.max(count: (10 - results.count) / 2, sortedBy: {$0.value < $1.value}))
results.append(contentsOf: zeroHintResults.max(count: 10 - results.count, sortedBy: {$0.value < $1.value}))
}
}

0 comments on commit c97dd9c

Please sign in to comment.