Skip to content

Instantly share code, notes, and snippets.

@yelinaung
Created May 13, 2015 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yelinaung/40d9d255956227172411 to your computer and use it in GitHub Desktop.
Save yelinaung/40d9d255956227172411 to your computer and use it in GitHub Desktop.
λ ~:mm-sort gem install ffi-icu
λ ~:mm-sort irb
2.2.2 :001 > require 'ffi-icu'
true
2.2.2 :002 > collator = ICU::Collation::Collator.new("mm")
#<ICU::Collation::Collator:0x007ff982336610 @c=#<FFI::AutoPointer address=0x007ff9837e2610>>
2.2.2 :003 > collator.collate(["အို", "အ", "အေ", "အု", "အော်", "အော", "အံ"])
[
[0] "အ",
[1] "အံ",
[2] "အို",
[3] "အု",
[4] "အေ",
[5] "အော",
[6] "အော်"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment