This package contains four kind of documents.
- "hz2py" and "corpus_ori" are the orignal corpus builting the Database "DB".
- "BuiltDB.py" and "readDB.py" are the .py documents to built the Database "DB".
- "demo.py" and "demo2.py" are the .py documents to test.
- I use the Viterbi algorithm in the "py2cnStr.py" to translate pinyin to Chinese characters.
How to run demo.py? $python2 demo.py You can see: "Loading language model... Finish
Please type in pinyin,use space to split,like "wo ai ke da"; USE [q]uit to quit"
Typing the pinyin str into the terminal, using enter to finish typing You can find the result as below "Input pinyin is: wo ai ke da Output Chinese is: 我爱科大"
Typing 'q' to quit the demo.