commonMain.ru.casperix.multiplatform.font.localize.CharacterExpandByLocale.kt Maven / Gradle / Ivy
package ru.casperix.multiplatform.font.localize
class CharacterExpandByLocale {
fun expand(characters: Set): Set {
val filteredAlphabets = CharacterSets.all.filter { alphabet ->
characters.firstNotNullOfOrNull { char ->
if (alphabet.charSet.contains(char)) char else null
} != null
}
var output = emptySet()
filteredAlphabets.forEach { alphabet ->
output = output + alphabet.charSet
}
return output + characters + CharacterSets.COMMON_CHARACTER_SET
}
}