/g2p-mix

Grapheme-to-Phoneme for Mixed Chinese and English

Primary LanguagePythonMIT LicenseMIT

g2p-mix

$ pip install g2p-mix
$ python
>>> from g2p_mix import G2pMix
>>> G2pMix().g2p("你这个idea, 不太make sense。")
[
  { "word": "", "phones": ["n", "i3"], "lang": "ZH" },
  { "word": "", "phones": ["zh", "e4"], "lang": "ZH" },
  { "word": "", "phones": ["g", "e4"], "lang": "ZH" },
  { "word": "idea", "phones": ["AY0", "D", "IY1", "AH0"], "lang": "EN" },
  { "word": ",", "phones": ",", "lang": "SYM" },
  { "word": "", "phones": ["b", "u4"], "lang": "ZH" },
  { "word": "", "phones": ["t", "ai4"], "lang": "ZH" },
  { "word": "make", "phones": ["M", "EY1", "K"], "lang": "EN" },
  { "word": "sense", "phones": ["S", "EH1", "N", "S"], "lang": "EN" },
  { "word": "", "phones": "", "lang": "SYM" }
]