Metadata-Version: 2.5
Name: rita-py
Version: 4.1.0
Summary: Python port of RiTa — a library for natural language and generative writing
Project-URL: Homepage, https://rednoise.org/rita
Project-URL: Repository, https://github.com/dhowe/rita
Project-URL: Documentation, https://rednoise.org/rita/reference
Project-URL: Issues, https://github.com/dhowe/rita/issues
Author-email: Daniel Howe <ritapy@rednoise.org>
License-Expression: GPL-3.0-only
License-File: LICENSE
Keywords: generative-text,natural-language,phonemes,rhyming,text-analysis
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Other Scripting Engines
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Artistic Software
Classifier: Topic :: Text Processing
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# rita — Python port of RiTa

RiTa is a library for computational language and generative writing, handling syllables,
phonemes and stresses, parts of speech, conjugation, pluralization, stemming,
letter-to-sound mapping, rhyming and alliteration, plus unbounded n-gram generation and
the RiScript scripting language for context-free grammars.

This is the Python port of [RiTa](https://rednoise.org/rita) from the original js - 
see the shared API reference [here](https://rednoise.org/rita/index.html#reference).

## Install

```sh
pip install rita-py
```

## Usage

```python
from rita import RiTa

RiTa.tokenize("I'm sure he'll be interested")
# ["I'm", "sure", "he'll", "be", "interested"]

RiTa.syllables("elephant")       # "eh/l-ah/f-ah-n-t"
RiTa.phones("elephant")          # "eh-l-ah-f-ah-n-t"
RiTa.rhymes("cat")               # ["bat", "begat", "brat", "chat", ...]
RiTa.pos("The dog ran")          # ["dt", "nn", "vbd"]

# RiScript
RiTa.evaluate("the [big | small] [dog | cat]")   # "the small dog"
```

## Notes
- Pure Python, no runtime dependencies. Python 3.10+
- Free/libre and licensed under GPL-3.0

## Development

The build is managed with [uv](https://docs.astral.sh/uv/):

```sh
uv sync              # create .venv and install dev deps
uv run pytest -q     # run the test suite
```