I use the Viterbi algorithm in the "py2cnStr.py" to translate pinyin to Chinese characters.