Metadata-Version: 2.4
Name: pyphonetik
Version: 0.2.1
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Text Processing :: Linguistic
Summary: Python bindings for the phonetik phonetic analysis engine.
Keywords: phonetics,rhyme,prosody,nlp,linguistics
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://docs.rs/phonetik
Project-URL: Repository, https://github.com/Void-n-Null/pyphonetik
Project-URL: Rust Crate, https://crates.io/crates/phonetik

# pyphonetik

Python bindings for [phonetik](https://crates.io/crates/phonetik), a phonetic analysis engine for English. Rhyme detection, scansion, syllable counting, and phonetic comparison backed by a 126K-word embedded dictionary.

## Install

```
pip install pyphonetik
```

## Usage

```python
from pyphonetik import Engine

p = Engine()

# Lookup
info = p.lookup("hello")
# {'word': 'HELLO', 'phonemes': ['HH', 'AH0', 'L', 'OW1'], 'syllable_count': 2, ...}

# Rhymes
p.perfect_rhymes("cat")  # [{'word': 'BAT', 'rhyme_type': 'perfect', ...}, ...]
p.slant_rhymes("love", 10)
p.near_rhymes("night", 10)
p.rhymes("cat", 50)  # all types, merged

# Scansion
scan = p.scan("shall I compare thee to a summer's day")
scan["meter"]["name"]  # 'iambic pentameter'
scan["syllable_count"]  # 10

# Compare
p.compare("cat", "bat")
# {'similarity': 0.6667, 'rhyme_type': 'perfect', 'confidence': 1.0, ...}

# Utilities
p.syllable_count("beautiful")  # 3
p.contains("hello")  # True
p.word_count()  # 126052
```

## Requirements

- Python >= 3.9
- No runtime dependencies. The dictionary is compiled into the binary.

## License

MIT

