PyCantonese uses the CHAT format for its HKCanCor data files (rendered as .cha files). This format is designed for conversational data and consists of two main components:
- Headers: Lines beginning with
@ containing metadata (e.g., @UTF8, @Begin, @Languages, @Participants, @ID, @Date, @Tape Number). - Transcriptions: Lines beginning with
* for the utterance, accompanied by annotations in the %mor (morphology) tiers.
Key Format Differences from Original Source
When working with these files, be aware of how the data has been transformed from the original HKCanCor source:
| Feature | CHAT Format Implementation |
|---|
| Languages | Specified in @Languages and @ID headers (typically yue, eng). |
| Participant Codes | Expanded to three characters (e.g., XXA, XXB) to comply with CHAT requirements. |
| Participant Age | If an age range was provided (e.g., 25-30), the lower number is used (e.g., 25). |
| Word Representation | Chinese characters are on the utterance line (*). Part-of-speech tags and Jyutping romanization are moved to the %mor tier (e.g., e|wai3). |
| Punctuation | Converted to ASCII. Chinese-style delimiters (parentheses, brackets) are collapsed into double quotes ("). Colons are removed to prevent parsing errors. |
Example CHAT File Structure
@UTF8
@Begin
@Languages: yue , eng
@Participants: XXA A Adult , XXB B Adult
@ID: yue , eng|HKCanCor|XXA|34;|female|||Adult||origin:HK|
@ID: yue , eng|HKCanCor|XXB|37;|female|||Adult||origin:HK|
@Date: 30-APR-1997
@Tape Number: 001
*XXA: 喂 遲 啲 去 唔 去 旅行 啊 ?
%mor: e|wai3 a|ci4 u|di1 v|heoi3 d|m4 v|heoi3 vn|leoi5hang4 y|aa3 ?
*XXA: 你 老公 有冇 平 機票 啊 ?
%mor: r|nei5 n|lou5gung1 v1|jau5mou5 a|peng4 n|gei1piu3 y|aa3 ?
*XXB: 平 機票 要 淡季 先 有得 平 𡃉 喎 .
%mor: a|peng4 n|gei1piu3 vu|jiu3 an|daam6gwai3 d|sin1 vu|jau5dak1 a|peng4 y|gaa3 y|wo3 .