Metadata-Version: 2.4
Name: cluesurf-talk
Version: 2.0.0
Summary: Tokenized IPA for AI and NLP, a keyboard-friendly ASCII phonetic encoding that converts to and from IPA with one token per effective sound.
Keywords: nlp,text-to-speech,transliteration,linguistics,tts,phonology,ipa,phonetics,computational-linguistics,romanization,writing-systems,international-phonetic-alphabet,phonetic-alphabet,phonetic-transcription
Author: Lance Pollard, ClueSurf
Author-email: Lance Pollard <lancejpollard@gmail.com>
License-Expression: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
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: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.9
Project-URL: Homepage, https://github.com/cluesurf/talk
Project-URL: Repository, https://github.com/cluesurf/talk
Project-URL: Issues, https://github.com/cluesurf/talk/issues
Description-Content-Type: text/markdown

# talk

A phonetic encoding. Convert between:

- **IPA** — the International Phonetic Alphabet (`tʰa`)
- **talk** — a plain-ASCII spelling of the same sounds (`th~a`)
- **simple** — a readable, human-facing rendering
- **token** — one Hangul code point per sound, for fixed-width machine use

Everything is derived from three data files and a double-array trie scan.
**Zero runtime dependencies.**

This is the Python port of [`@cluesurf/talk`](https://github.com/cluesurf/talk).
Both ports share one source of truth for the phonetic data.

## Install

```bash
pip install cluesurf-talk
# or
uv add cluesurf-talk
```

## Use

```python
import talk

talk.ipa_to_talk("tʰa")    # "th~a"
talk.talk_to_ipa("th~a")   # "tʰa"
talk.readable("th~a")      # "tʰa"
talk.machine("th~a")       # one Hangul code point per sound

# Break a talk string into sounds with their features.
for sound in talk.segment("th~a"):
    print(sound.talk, sound.kind, sound.base and sound.base.talk,
          [m.feature for m in sound.modifiers])

# The full canonical inventory.
talk.enumerate_sounds()
```

## API

| Function | Description |
| --- | --- |
| `ipa_to_talk(text)` | IPA → talk |
| `talk_to_ipa(text)` | talk → IPA |
| `readable(text)` | talk → simple readable form |
| `machine(text)` | talk → one Hangul code point per sound |
| `machine_outputs(text)` | talk → list of per-sound code points |
| `segment(text)` / `tokenize(text)` | talk → list of `Sound` |
| `enumerate_sounds()` | the full canonical sound inventory |
| `combine(base_talk, mods)` | base + modifiers → canonical talk spelling |

## License

MIT

## ClueSurf

Part of the [ClueSurf](https://clue.surf) toolset.
