Optimized the pinyin algor.