-
-
Save andjc/6be24c1de1093e4bd7340f3a1b68426c to your computer and use it in GitHub Desktop.
Thai Sort
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import icu | |
thkey = icu.Collator.createInstance(icu.Locale('th_TH')).getSortKey | |
words = 'ไก่ ไข่ ก ฮา'.split() | |
print(sorted(words, key=thkey)) # ['ก', 'ไก่', 'ไข่', 'ฮา'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment