Skip to content

Instantly share code, notes, and snippets.

@andjc
Forked from korakot/thaisort.py
Created February 20, 2023 10:44
Embed
What would you like to do?
Thai Sort
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