Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 730 Bytes

README.md

File metadata and controls

23 lines (19 loc) · 730 Bytes

This package contains four kind of documents.

  1. "hz2py" and "corpus_ori" are the orignal corpus builting the Database "DB".
  2. "BuiltDB.py" and "readDB.py" are the .py documents to built the Database "DB".
  3. "demo.py" and "demo2.py" are the .py documents to test.
  4. 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.