Skip to main content

ASJP conversion and tokenisation utils

Project description

A small library of three functions. ipa2asjp takes an IPA-encoded string and converts it into an ASJP-encoded one. asjp2ipa tries to do the opposite. tokenise takes an ASJP-encoded string and returns a list of tokens.

>>> from asjp import ipa2asjp, asjp2ipa, tokenise
>>> ipa2asjp('lit͡sɛ')
'ly~icE'
>>> tokenise(ipa2asjp('lit͡sɛ'))
['ly~', 'i', 'c', 'E']
>>> [ipa2asjp(t) for t in ['l', '', 't͡s', 'ɛ']] == tokenise(ipa2asjp('lit͡sɛ'))
True
>>> asjp2ipa(ipa2asjp('lit͡sɛ')) == lit͡sɛ
True

licence

MIT. Do as you please and praise the snake gods.

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

asjp-0.0.0.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

asjp-0.0.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

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