Metadata-Version: 2.4
Name: pysinrom
Version: 0.1.0
Summary: Python tools for Sinitic romanization, currently only as research utilities for conversion between Jyutping and CantRomZJ1
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pycantonese<6,>=5.0
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Dynamic: license-file

# PySinRom

## Installation

After publication on PyPI:

```bash
pip install pysinrom
```

For local installation from the project directory:

```bash
python -m pip install .
```

## Usage

```python
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:

```python
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.
