Skip to content

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

Notifications You must be signed in to change notification settings

maoleo/latin2chinese

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published