Files
ports/misc/py-misaki/files/usage-ja.py
T
2026-10-04 04:07:15 +00:00

17 lines
417 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
To run:
uv venv --seed -p 3.11
uv pip install ".[en]"
uv run examples/usage.py
"""
from misaki import ja
g2p = en.G2P(trf=False, fallback=None) # no transformer, American English
text = '素敵な午後をお過ごしください。また後ほどお会いしましょう。'
phonemes, tokens = g2p(text)
print(phonemes) # misˈɑki ɪz ə ʤˈitəpˈi ˈɛnʤən dəzˈInd fɔɹ kˈOkəɹO mˈɑdᵊlz.