I have raw Chinese mandarin vocabulary lists for HSK5 in the format below*. I want to sort these so that the individual characters alphabetized and sorted by frequency as below** * 阿姨 a1yi2 啊 a5 哎 ai1 矮 ai3 爱 ai4 ** Char Pinyin Freq. 哎 Ai1 1 矮 Ai3 1 爱 Ai4 11 唉 Ai4 1 安 An1 7 岸 An4 1 HSK5 has 2500 Chinese words to be learned all made up of one or more characters. I want them grouped in this way so i can learn them more easily using mnemonics. Any instruction as to what books to read or how to even begin writing the algorithm is welcome. i have no experience in writing algorithms but am willing to learn.