@@ -17,17 +17,21 @@ For these reasons, PyCantonese adopts the `CHAT <https://talkbank.org/0info/manu
1717corpus format from CHILDES and TalkBank.
1818CHAT is widely used, well-documented, and rich for linguistic annotations.
1919PyCantonese uses the library
20- `Rustling <https://rustling.readthedocs .io/stable/chat.html >`_ to parse CHAT data files.
20+ `Rustling <https://docs.rustling .io/stable/chat.html >`_ to parse CHAT data files.
2121For a primer on the CHAT data format, please see
22- `here <https://docs.pylangacq.org /stable/transcriptions.html#chat-format >`_.
22+ `here <https://docs.rustling.io /stable/chat /transcriptions.html#chat-format >`_.
2323
2424
2525Built-in Data
2626-------------
2727
28- Currently, PyCantonese comes with one built-in corpus, the
29- `Hong Kong Cantonese Corpus <https://github.com/fcbond/hkcancor >`_
30- (HKCanCor; license: CC BY), via the function :func: `~pycantonese.hkcancor `:
28+ PyCantonese ships with two built-in corpora: HKCanCor and CantoMap.
29+
30+ HKCanCor
31+ ^^^^^^^^
32+
33+ The `Hong Kong Cantonese Corpus <https://github.com/fcbond/hkcancor >`_
34+ (HKCanCor; license: CC BY) is available via the function :func: `~pycantonese.hkcancor `:
3135
3236.. code-block :: python
3337
@@ -46,11 +50,39 @@ They have been converted to CHAT for incorporation into PyCantonese.
4650On the format conversion, please consult this
4751`readme <https://github.com/jacksonllee/pycantonese/blob/main/src/pycantonese/data/hkcancor/README.md >`_.
4852
53+ CantoMap
54+ ^^^^^^^^
55+
56+ The `CantoMap <https://github.com/gwinterstein/CantoMap >`_ corpus
57+ (license: GPL-3.0) is a collection of contemporary Hong Kong Cantonese
58+ conversation recordings from MapTask exercises.
59+ It is available via the function :func: `~pycantonese.cantomap `:
60+
61+ .. code-block :: python
62+
63+ import pycantonese
64+ cantomap = pycantonese.cantomap()
65+ cantomap.n_files # number of data files
66+ # 99
67+ len (cantomap.words()) # number of words as segmented from all the utterances
68+ # 118572
69+
70+ CantoMap is word-segmented and annotated for Jyutping romanization.
71+ Part-of-speech tags (HKCanCor tagset) are added by PyCantonese's POS tagger
72+ during the conversion from ELAN to CHAT format.
73+
74+ The original CantoMap source files are in the ELAN annotation format (``.eaf ``).
75+ Because the CHAT format inherently requires word-segmented data,
76+ it is a natural fit for the word-segmented, Jyutping-annotated CantoMap data.
77+ The ELAN files have been converted to CHAT for incorporation into PyCantonese.
78+ On the format conversion, please consult this
79+ `readme <https://github.com/jacksonllee/pycantonese/blob/main/src/pycantonese/data/cantomap/README.md >`_.
80+
4981
5082CHILDES and TalkBank Data
5183-------------------------
5284
53- For corpora other than HKCanCor , PyCantonese provides the function :func: `~pycantonese.read_chat `
85+ For corpora beyond the built-in ones , PyCantonese provides the function :func: `~pycantonese.read_chat `
5486to read in Cantonese data in the CHAT format.
5587
5688As of 2026, CHAT datasets are publicly available from `TalkBank <https://talkbank.org/ >`_.
@@ -63,35 +95,43 @@ before you can download the full transcripts as a ZIP archive to your local driv
6395
6496Here are the Cantonese-related TalkBank datasets (in alphabetical order):
6597
66- * `Child Heritage Chinese Corpus <https://childes. talkbank.org/access/Biling/CHCC.html >`_
98+ * `Child Heritage Chinese Corpus <https://talkbank.org/childes /access/Biling/CHCC.html >`_
6799
68- * `Guthrie Bilingual Corpus <https://childes. talkbank.org/access/Biling/Guthrie.html >`_
100+ * `Guthrie Bilingual Corpus <https://talkbank.org/childes /access/Biling/Guthrie.html >`_
69101
70- * `HKU-70 Corpus <https://childes. talkbank.org/access/Chinese/Cantonese/HKU.html >`_
102+ * `HKU-70 Corpus <https://talkbank.org/childes /access/Chinese/Cantonese/HKU.html >`_
71103
72- * `Lee-Wong-Leung Corpus <https://childes. talkbank.org/access/Chinese/Cantonese/LeeWongLeung.html >`_
104+ * `Lee-Wong-Leung Corpus <https://talkbank.org/childes /access/Chinese/Cantonese/LeeWongLeung.html >`_
73105
74106* `Mandarin-Cantonese-English EACMC Corpus <https://talkbank.org/childes/access/Biling/EACMC.html >`_
75107
76- * `Yip-Matthews Bilingual Corpus <https://childes. talkbank.org/access/Biling/YipMatthews.html >`_
108+ * `Yip-Matthews Bilingual Corpus <https://talkbank.org/childes /access/Biling/YipMatthews.html >`_
77109
78110
79111Custom Data
80112-----------
81113
82- If you have your own CHAT data locally and would
83- like PyCantonese to handle it, :func: `~pycantonese.read_chat `
84- takes a path that can be a ZIP archive, a local directory, or a single CHAT file.
85-
86- If more fine-grained control is needed when reading data, please check out
87- :class: `~pycantonese.CHAT `, particularly the following methods:
88-
89- * :py:meth: `~pycantonese.CHAT.from_zip `
90- * :py:meth: `~pycantonese.CHAT.from_dir `
91- * :py:meth: `~pycantonese.CHAT.from_files `
92- * :py:meth: `~pycantonese.CHAT.from_strs `
93-
94- The CHAT parser comes from `Rustling <https://rustling.readthedocs.io/stable/chat.html >`_,
95- which both PyCantonese and PyLangAcq use.
96- For more on reading CHAT data in general, please see
97- `PyLangAcq's documentation <https://docs.pylangacq.org/stable/read.html >`_.
114+ If you have your own CHAT data,
115+ :func: `~pycantonese.read_chat ` accepts a local ZIP archive,
116+ a local directory, or a single ``.cha `` file path.
117+
118+ For more control over how data is read, the :class: `~pycantonese.CHAT ` class
119+ provides the following class methods:
120+
121+ * :py:meth: `~pycantonese.CHAT.from_zip ` -- local ZIP archive
122+ * :py:meth: `~pycantonese.CHAT.from_dir ` -- local directory
123+ * :py:meth: `~pycantonese.CHAT.from_files ` -- one or more local file paths
124+ * :py:meth: `~pycantonese.CHAT.from_strs ` -- in-memory strings
125+ * :py:meth: `~pycantonese.CHAT.from_git ` -- Git repository (cloned and cached)
126+ * :py:meth: `~pycantonese.CHAT.from_url ` -- URL to a ZIP archive (downloaded and cached)
127+
128+ The CHAT parser is powered by `Rustling <https://docs.rustling.io/stable/chat.html >`_,
129+ with Cantonese-specific additions for Jyutping romanization, Chinese characters,
130+ and a general corpus search function.
131+
132+ If your data is in one of the
133+ `formats supported by Rustling <https://docs.rustling.io/stable/ >`_,
134+ you can use Rustling to parse it, apply any processing you need,
135+ and create a :class: `~pycantonese.CHAT ` object via :py:meth: `~pycantonese.CHAT.from_strs `.
136+ For an example of this workflow, see how the CantoMap ELAN data is
137+ `converted for use in PyCantonese <https://github.com/jacksonllee/pycantonese/blob/main/src/pycantonese/data/cantomap/README.md >`_.
0 commit comments