Releases: jacksonllee/pycantonese
Releases · jacksonllee/pycantonese
Release list
v5.0.0
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.
v4.3.0
Added
- Added a
g2pwrapper function for grapheme-to-phoneme conversion.
v4.2.0
Added
- Added the CantoMap corpus.
- Added
from_gitandfrom_urltoCHATto support fetching datasets from remote sources.
Changed
- Bumped rustling to >= 0.8.0.
v4.1.0
Added
segment()for word segmentation now takes a boolean keyword argumentoffsets
to optionally give the(start, end)indices of the segmented words.
Changed
- Bumped rustling to >= 0.7.0, for retrieving offsets in word segmentation.
Fixed
segment()for word segmentation now splits a mixed Cantonese/English unit as separate
words if it's not already a recognized mixed word.
v4.0.0
The major version bump from v3 to v4 is due to backward-incompatible yet minor
API changes triggered by the switch from the PyLangAcq + wordseg
dependencies to Rustling for handing CHAT data, word segmentation, and
part-of-speech tagging.
Added
- Added the new function
jyutping_to_ipafor Jyutping-to-IPA conversion. - The
characters_to_jyutpingfunction can now take a list of strings as input
with user-provided word segmentation. - Added support for Python 3.11, 3.12, 3.13, and 3.14.
Changed
- Switched to Rustling as the underlying engine
for CHAT data parsing, word segmentation, and part-of-speech tagging;
dropped PyLangAcq and wordseg as dependencies. CHATReaderhas been renamedCHATand switched from PyLangAcq's legacy pure-Python
parser to a Rust-based parser from Rustling, with various API changes
for method names, arguments, etc.- The word segmentation model has been updated to a semi-supervised hybrid approach
that combines a DAG and hidden Markov model.
Thesegmentfunction for word segmentation no longer accepts an argument
for a custom segmenter. - For both word segmentation and part-of-speech tagging, the persisted models
shipped with the package are now zstd-compressed FlatBuffers binaries.
Removed
- Dropped support for Python 3.7, 3.8, and 3.9.
Fixed
- Fixed word segmentation so that spaces between English words
in the user input are now honored as word boundaries. - If
parse_textis given an empty input orNone,
now an emptyCHATinstance is returned. - If
parse_textis given a non-empty list of utterances,
then any empty utterance (e.g.,None,"")
will now be represented by an emptyUtteranceinstance inside the resultingCHAToutput. - Fixed the HKCanCor-to-UD mapping for
G1mapped toVERBnotV.
v3.4.0
[3.4.0] - 2021-12-28
Added
- Added the
parse_textfor analyzing Cantonese text data. - Characters-to-Jyutping conversion:
Thecharacters_to_jyutpingfunction now has thesegmenterkwarg for
customizing word segmentation. - Added support for Python 3.10.
- Turned on Windows testing on CircleCI.
- Added
pyproject.toml. Related to preferringsetup.cfgfor specifying
build metadata and options.
Changed
- Characters-to-Jyutping conversion:
For thecharacters_to_jyutpingfunction,
in case rime-cantonese and HKCanCor don't agree,
rime-cantonese data (more accurate) is preferred. - Updated the rime-cantonese data to the latest
2021.05.16release,
improving both characters-to-Jyutping conversion and word segmentation. - Updated the PyLangAcq dependency to v0.16.0, allowing PyCantonese's
CHATReader
to use the new methodsto_chat,to_strs,info,head, andtail. - Switched to
setup.cfgto fully specify build metadata and options,
while keeping a minimalsetup.pyfor backward compatibility.
Related to the newpyproject.toml.
Removed
- Dropped support for Python 3.6.
Security
- Turned on
safetyandbanditchecks at CircleCI builds.
v3.3.1
[3.3.1] - 2021-05-14
Fixed
- Allowed PyLangAcq v0.14.* for real.
v3.3.0
[3.3.0] - 2021-05-14
Changed
- Allow PyLangAcq v0.14.*, thereby adding the new features of the
filtermethod toCHATReader
and optional parallelization for CHAT data processing.
Fixed
- Fixed the
searchmethod ofCHATReaderwhenby_tokensisFalse.
v3.2.4
[3.2.4] - 2021-05-07
Fixed
- Fixed the previously inoperational methods
append,append_left,extend, andextend_left
of the classCHATReaderthrough the upstream PyLangAcq package. - Retrained the part-of-speech tagger, after the minor character fix from v3.2.3.
- Raised
NotImplementedErrorfor the methodipsynofCHATReader,
since the upstream method works only for English.
v3.2.3
[3.2.3] - 2021-04-12
Fixed
- Fixed character issues in the built-in HKCanCor data: 𥄫