Skip to main content

PyCantonese: Cantonese Linguistics and NLP in Python

Full Documentation: https://pycantonese.org


PyPI version Supported Python versions CircleCI Builds

PyCantonese is a Python library for Cantonese linguistics and natural language processing (NLP). Currently implemented features (more to come!):

  • Accessing and searching corpus data

  • Parsing and conversion tools for Jyutping romanization

  • Stop words

  • Word segmentation

  • Part-of-speech tagging

Download and Install

To download and install the stable, most recent version:

$ pip install --upgrade pycantonese

Ready for more? Check out the Quickstart page.

Consulting

If your team would like professional assistance in using PyCantonese, technical consulting and training services are available. Please email Jackson L. Lee.

Support

If you have found PyCantonese useful and would like to offer support, buying me a coffee would go a long way!

How to Cite

PyCantonese is authored and maintained by Jackson L. Lee.

A talk introducing PyCantonese:

Lee, Jackson L. 2015. PyCantonese: Cantonese linguistic research in the age of big data. Talk at the Childhood Bilingualism Research Centre, Chinese University of Hong Kong. September 15. 2015. Notes+slides

License

MIT License. Please see LICENSE.txt in the GitHub source code for details.

The HKCanCor dataset included in PyCantonese is substantially modified from its source in terms of format. The original dataset has a CC BY license. Please see pycantonese/data/hkcancor/README.md in the GitHub source code for details.

The rime-cantonese data (release 2020.09.09) is incorporated into PyCantonese for word segmentation and characters-to-Jyutping conversion. This data has a CC BY 4.0 license. Please see pycantonese/data/rime_cantonese/README.md in the GitHub source code for details.

Acknowledgments

Wonderful resources with a permissive license that have been incorporated into PyCantonese:

  • HKCanCor

  • rime-cantonese

Individuals who have contributed feedback, bug reports, etc. (in alphabetical order of last names):

  • @cathug

  • Litong Chen

  • Jenny Chim

  • @g-traveller

  • Rachel Han

  • Ryan Lai

  • Charles Lam

  • Chaak Ming Lau

  • Hill Ma

  • @richielo

  • @rylanchiu

  • Stephan Stiller

  • Tsz-Him Tsui

  • Robin Yuen

Changelog

Please see CHANGELOG.md.

Setting up a Development Environment

The latest code under development is available on Github at jacksonllee/pycantonese. You need to have Git LFS installed on your system. To obtain this version for experimental features or for development:

$ git clone https://github.com/jacksonllee/pycantonese.git
$ cd pycantonese
$ git lfs pull
$ pip install -r dev-requirements.txt
$ pip install -e .

To run tests and styling checks:

$ pytest -vv --doctest-modules --cov=pycantonese pycantonese docs/source
$ flake8 pycantonese
$ black --check pycantonese

To build the documentation website files:

$ python build_docs.py

Metadata

Release files for pycantonese 3.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycantonese 3.2.3
File Size Uploaded Provenance Actions
pycantonese-3.2.3.tar.gz 3.8 MB Without provenance Details for pycantonese-3.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pycantonese 3.2.3
File Interpreter ABI Platform Actions
pycantonese-3.2.3-py3-none-any.whl Python 3 none any Details for pycantonese-3.2.3-py3-none-any.whl

Total release size: 7.7 MB

Release files / pycantonese-3.2.3.tar.gz

Download URL pycantonese-3.2.3.tar.gz
Size 3.8 MB
Tags Source
SHA-256 checksum
How to use checksums
fbc95135953413ab6235f4be621cf6a68287dc1557eb714808e6d896ddc22469
BLAKE2b-256 checksum
How to use checksums
5f29148cecead486f0c813944a562a66a11da303ba82434ca5e30f0c6e1abd43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.7.0 requests/2.24.0 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / pycantonese-3.2.3-py3-none-any.whl

Download URL pycantonese-3.2.3-py3-none-any.whl
Size 3.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
299cee4d6d1a7b5d26ce4dbbb71d65b90a3dbafe49b504b128b615be017fd37c
BLAKE2b-256 checksum
How to use checksums
e270f2afb5556e6676fed45ef97827c51e26ba3134ef8227159a28af017a149e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.7.0 requests/2.24.0 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Security for pycantonese 3.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page