Skip to main content

Tokenized IPA for AI and NLP, a keyboard-friendly ASCII phonetic encoding that converts to and from IPA with one token per effective sound.

Project description

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. Both ports share one source of truth for the phonetic data.

Install

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

Use

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 toolset.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cluesurf_talk-2.0.0.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cluesurf_talk-2.0.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file cluesurf_talk-2.0.0.tar.gz.

File metadata

  • Download URL: cluesurf_talk-2.0.0.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cluesurf_talk-2.0.0.tar.gz
Algorithm Hash digest
SHA256 69371cc734d63a47294aad30c960da9865ec4486c90f2f8c4ff0ff1c72fe4a92
MD5 01b9caf9d112fb7f7eb55af510e74d93
BLAKE2b-256 47d745b606345488da1f409ec218edb52e840472efe969c80bd9fb214b14e304

See more details on using hashes here.

File details

Details for the file cluesurf_talk-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: cluesurf_talk-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cluesurf_talk-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a521661afda36c44f78afe4348bf591f8f7e3e6f83907a2600fca59101fc142b
MD5 858bcc60a24cfde0a79255a2536a70c1
BLAKE2b-256 5d93a1bb692b497ba0c99cd34625b593b37f9a0700dce5067f8c8176abd8dedd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page