pycantonese.read_chat

pycantonese.read_chat(path: str | PathLike[str], *, filter_files: str | Sequence[str] | None = None, filter_participants: str | Sequence[str] | None = None, strict: bool = True) CHAT[source]

Read Cantonese CHAT data files.

Parameters:
pathstr or os.PathLike[str]

A path that points to one of the following:

  • A local .zip file path.

  • A local directory, for files under this directory recursively.

  • A single .cha CHAT file.

filter_filesstr or Sequence[str], optional

Filename(s) to keep. Regular expression matching is supported. If None, all files are included.

filter_participantsstr or Sequence[str], optional

Participant code(s) to keep. Regular expression matching is supported. If None, all participants are included.

strictbool, optional

If True, enforce strict parsing of the CHAT data.

Returns:
CHAT