Repository navigation
This release incremented the major version number to v5 for the API breaking changes
related to various conversion functions for Jyutping romanization.
Please see the notes below for details.
Added
- Added
yale_to_jyutpingto convert Yale romanization into Jyutping. characters_to_jyutping,jyutping_to_ipa,jyutping_to_yale,
yale_to_jyutping, andjyutping_to_tipanow all acceptstr | list[str]
as input. Astris treated as a single word with no word segmentation;
alist[str]carries explicit word segmentation, one word per element.- Added
stringify_yaleto take the output ofjyutping_to_yaleand return
a string with apostrophes for disambiguating syllable boundaries. parse_jyutpingnow tolerates whitespace between syllables in its input
string.
Changed
- Breaking:
characters_to_jyutping,jyutping_to_ipa,
jyutping_to_yale,yale_to_jyutping,jyutping_to_tipa, andg2pnow
use a single space to separate the per-syllable representations within
each word in their output. For example,
characters_to_jyutping('廣東話')returns[('廣東話', 'gwong2 dung1 waa2')]
rather than the previous[('廣東話', 'gwong2dung1waa2')]. The underlying
rime-cantonese data file (chars_to_jyutping.json) is regenerated with
the same convention so that downstream consumers can recover syllables
viastr.split(). - Breaking:
g2pnow returnslist[tuple[str, str | None]](the IPA
element is a single space-separated string), replacing the previous
list[tuple[str, list[str] | None]]shape.
Removed
- Breaking: removed the
return_askeyword argument from
jyutping_to_ipa,jyutping_to_yale, andyale_to_jyutping.
These functions now always return a list of strings. - Breaking: removed the apostrophe-disambiguation behavior that
jyutping_to_yalepreviously applied underreturn_as="string". The
space between syllables in the new output resolves the same ambiguity.
Please note:- The new
stringify_yaletakes the output ofjyutping_to_yaleand returns
a string with apostrophes for disambiguating syllable boundaries. - In
yale_to_jyutpinginput, apostrophes are still accepted but are now
treated identically to whitespace as a syllable-boundary hint within a
single word.
- The new
Fixed
- Fixed
jyutping_to_yalemapping for thekwonset, which was incorrectly
mapped tok.