Skip to main content

G2P mix

Project description

g2p-mix

Usage

$ pip install g2p-mix
$ python

Mandarin

>>> from g2p_mix import G2pMix
>>> G2pMix().g2p("你这个idea, 不太make sense。", sandhi=True)
[
  { "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", "u2"], "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" }
]

Cantonese

>>> G2pMix(jyut=True).g2p("你这个idea, 不太make sense。")
[
  { "word": "你", "phones": ["n", "ei5"], "lang": "ZH" }
  { "word": "這", "phones": ["z", "e3"], "lang": "ZH" }
  { "word": "個", "phones": ["g", "o3"], "lang": "ZH" }
  { "word": "idea", "phones": ["AY0", "D", "IY1", "AH0"], "lang": "EN" }
  { "word": ",", "phones": ",", "lang": "SYM" }
  { "word": "不", "phones": ["b", "at1"], "lang": "ZH" }
  { "word": "太", "phones": ["t", "aai3"], "lang": "ZH" }
  { "word": "make", "phones": ["M", "EY1", "K"], "lang": "EN" }
  { "word": "sense", "phones": ["S", "EH1", "N", "S"], "lang": "EN" }
  { "word": "。", "phones": "。", "lang": "SYM" }
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

g2p-mix-0.5.1.tar.gz (5.0 MB view details)

Uploaded Source

File details

Details for the file g2p-mix-0.5.1.tar.gz.

File metadata

  • Download URL: g2p-mix-0.5.1.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for g2p-mix-0.5.1.tar.gz
Algorithm Hash digest
SHA256 09d9b5cc62b792ca247a43fe18a0a2e8abc6ddff787c32091020ffcae56e5dc6
MD5 b3afcbc764783c50beeef93363082b57
BLAKE2b-256 f44c9e19278abe7ed19dff49d03d25e8849984f3cbf4e518df20c1d7ba91fbd4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page