Chinese is generally sorted according to pinyin and strokes. You need to create a mapping table of Chinese characters and pinyin or stroke numbers, and then compare them through the corresponding pinyin or strokes.
If the questioner’s requirement here is just to compare “one, two, three, four, five, six, seven, eight, nine, ten”. You can create a comparison table as follows:
一 -> 1
二 -> 2
三 -> 3
四 -> 4
……
十 -> 10
Then it is very simple to use the comparison value to sort.
python3
Map Chinese characters and numbers and compare them
dic={'一':1,'二':2,'三':3,'四':4}
Chinese is generally sorted according to pinyin and strokes.
You need to create a mapping table of Chinese characters and pinyin or stroke numbers, and then compare them through the corresponding pinyin or strokes.
If the questioner’s requirement here is just to compare “one, two, three, four, five, six, seven, eight, nine, ten”.
You can create a comparison table as follows:
Then it is very simple to use the comparison value to sort.