Skip to main content

Python tools for Sinitic romanization, currently only as research utilities for conversion between Jyutping and CantRomZJ1

Project description

PySinRom

Installation

After publication on PyPI:

pip install pysinrom

For local installation from the project directory:

python -m pip install .

Usage

from pysinrom import (
    jyutping_to_cantromzj1,
    cantromzj1_to_jyutping,
)

cantromzj1, syllables = jyutping_to_cantromzj1("hoeng1gong2")
print(cantromzj1)
# heong1A|55gong2A|35

jyutping, syllables = cantromzj1_to_jyutping("heong1A|55gong2A|35")
print(jyutping)
# hoeng1gong2

Space-separated input and output are also supported:

result = jyutping_to_cantromzj1(
    "hoeng1 gong2",
    output_separator=" ",
    return_mode="string",
)
print(result)
# heong1A|55 gong2A|35

Main functions

  • jyutping_to_cantromzj1()
  • jyutping_syllable_to_cantromzj1()
  • cantromzj1_to_jyutping()
  • cantromzj1_syllable_to_jyutping()
  • parse_cantromzj1()
  • parse_cantromzj1_syllable()

The default return mode for full-string conversion is a tuple containing the joined output string and a list of converted syllables. Set return_mode="string" or return_mode="list" to request only one representation.

Development status

This is research software released as an alpha version. The current implementation focuses on the romanization correspondences described in the accompanying anonymous manuscript.

License

MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysinrom-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysinrom-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file pysinrom-0.1.0.tar.gz.

File metadata

  • Download URL: pysinrom-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pysinrom-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7b33b8dc17e7a996202bf0478eae33987ebb3a8bf0657ae41028e3e6141d766
MD5 c12e1c65ffbf96165f0a350a671ecc53
BLAKE2b-256 07d0af588b2431326ef98fa94f11901b13e52b456136911b10d15ba5a0bb05d3

See more details on using hashes here.

File details

Details for the file pysinrom-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysinrom-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pysinrom-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebcd93366f66d6d44a4a0495652e649616e8a91a6fe5ee0c35a76198907df72d
MD5 a43781825b0aa6b1d631625dd0a66972
BLAKE2b-256 6f5197042ed3a521342f0275d7b0cad21208cd2b73bde43f424e3da7497b0772

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page