This commit is contained in:
minjaesong
2021-10-28 11:05:12 +09:00
parent 18e59ed46b
commit 9f70500a41
3 changed files with 3 additions and 5 deletions

View File

@@ -57,9 +57,9 @@ class IMEDictionary(private val filename: String) {
var index = keys.searchForInterval(key) { it }.second
val allRelevantKeys = ArrayList<String>() // oh, oha, ohag, ohbt, ohby, ...
for (i in 0 until 400) { // lookahead for length-first sorting, longest lookahead possible is around 300, so I'll give it 400
if (index + 1 >= keys.size) break
val keysym = keys[index + i]
for (k in 0 until 400) { // lookahead for length-first sorting, longest lookahead possible is around 300, so I'll give it 400
if (index + k >= keys.size) break
val keysym = keys[index + k]
if (!keysym.startsWith(key)) break
allRelevantKeys.add(keysym)
}