Implement generate pinyin.