I want to sort strings of chinese characters. I used to use below code

AlphabeticSort[list, Entity["Language", "ChineseMandarin"]]

And it worked. But now it returns an error message

AlphabeticSort::nalph: The alphabet Mandarin is not known or not available.

What is wrong? How to work around this?

  • $\begingroup$ Unfortunately, under the "Possible issues" for Alphabet (which is used by AlphabeticSort), it shows this issue. Japanese does appear to work - if Chinese also sorts by stroke count, perhaps that's a useful workaround? $\endgroup$ – Carl Lange Apr 17 '19 at 7:38

The following gives an answer (which I don't know if it is correct, not being able to read Chinese):

AlphabeticSort[list, Entity["Language", "Chinese"]]
(* {"大家", "好", "早上"} *)

I'm not sure why "ChineseMandarin" doesn't work. Could be a bug in the translation layer from langauges to sorting order.

  • $\begingroup$ Great, works, Thank you : ) $\endgroup$ – matheorem Apr 21 '19 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.