This release is a pre-release and may not be stable for production use.
RoManTools - Romanized Mandarin Tools
This package comprises a set of tools designed to facilitate the handling of romanized Mandarin text. It is currently under active development by Jeff Heller, Digital Project Specialist for the Department of East Asian Studies at Princeton University. This is a beta release, open for testing and forking.
Features Planned for Version 1.0
Version 1.0 of this project will include the following features:
- Conversion between Romanization Standards: Support for converting between Pinyin and Wade-Giles (with Yale and additional standards to be added in future versions).
- Cherry Pick: Converts only identified romanized Chinese terms, excluding any English words or those in a stopword list.
- Text Segmentation: Segments text into meaningful chunks, a feature that will be utilized by other features but also available for direct use by the user.
- Syllable Count: Counts the number of syllables per word and reports the list to the user.
- Method Detect: Identifies the romanization standard used in the input text and returns the detected standard(s) to the user as either a single standard or a list of multiple standards.
- Validator: Basic validation of supplied text.
Prerequisites
There are no prerequisites. RoManTools was originally built using Numpy 2D arrays, but this has since been replaced with nested tuples.
Installation
To install RoManTools, the easiest method is through pip:
pip -m install RoManTools
You can also download the package directly from the GitHub repository. This method is not recommended as it requires a specific execution process, detailed in the last bullet point below.
Execution
RoManTools can be executed in three ways.
- From the command-line using the installed command:
RoManTools [action] -i [input] [other parameters]
- From within the Python console or scripts via import:
from RoManTools import *
[action]([input], [other parameters])
- From the command-line after downloading the package directly from GitHub:
python -m RoManTools.main [action] -i [input] [other parameters]
Documentation on command-line execution can be found in CLI.md, as well as execution within Python from Python.md. Please refer to Input_Requirements.md for guidelines on how text should be formatted for input, and Methodology.md will provide details on the text analysis process.
Possible Future Goals (suggestions welcome!)
- Feedback: Provide meaningful and specific error messages for incorrect syntax (e.g.,
missing or invalid final: chy,extraneous characters: "(2)",Xui is not a valid Wade-Giles syllable.). - IPA Pronunciation: Convert between romanized text and the International Phonetic Alphabet.
- Tone Marking Conversion: Convert between tone marking systems (numerical and IPA).
- Audio Pronunciation: Produce audio recordings of inputted text.
- Flashcards/Quizzes: Gamification of text input and pronunciation.
- To submit suggestions for future updates, contact main developer Jeff Heller via Github issues or via e-mail.
Origin
This project originated as the syllable_count function developed for use with the Tang History Database, led by Professor Anna Shields of the Department of East Asian Studies at Princeton University. The objective was to validate user input of romanized Mandarin, facilitating the incorporation of data from Harvard University's Chinese Biographical Database (CBDB). By analyzing the syllable structure of romanized Mandarin strings and comparing them to corresponding Chinese characters, the function initially focused on validating the entry of Tang dynasty figures' names. As the project evolved, it expanded to include robust error handling, detection of both Pinyin and Wade-Giles romanization systems, and cross-system translation, even within mixed English text. The motivation to release this tool as a publicly available package stems from the need for a fast, efficient solution to validate romanized Mandarin text, promoting consistency in future datasets and ensuring flawless adherence to romanization standards.
Metadata
Release files for RoManTools 0.2.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| romantools-0.2.0b2.tar.gz | 66.5 kB | With provenance | Details for romantools-0.2.0b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| RoManTools-0.2.0b2-py3-none-any.whl | Python 3 | none | any | Details for RoManTools-0.2.0b2-py3-none-any.whl |
Total release size: 126.0 kB
Release files / romantools-0.2.0b2.tar.gz
| Download URL | romantools-0.2.0b2.tar.gz |
|---|---|
| Size | 66.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29cd7f1363fe58633cad3be2153675afb18ac34fdde2a97e8ef8102ddc9bc1a1
|
|
BLAKE2b-256 checksum How to use checksums |
8c516265163d76ff9a332a2d324593800cf758ffad603cac8201c685adeaf1ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 31, 2025.
Transparency logRelease files / RoManTools-0.2.0b2-py3-none-any.whl
| Download URL | RoManTools-0.2.0b2-py3-none-any.whl |
|---|---|
| Size | 59.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c0d949fb7c49ecb548c49e576f03b2b355fb7d3d6bbb8af083efa89000cea97
|
|
BLAKE2b-256 checksum How to use checksums |
43607b05eba34cc14f741aa146a949127e34647e4d9281b3bb68d3fdff7de3c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 31, 2025.
Transparency logSecurity for RoManTools 0.2.0b2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for romantools-0.2.0b2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 31, 2025.
Transparency logA 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.