Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imatpot/typst-ascii-ipa
🔄 ASCII / IPA conversion for Typst
https://github.com/imatpot/typst-ascii-ipa
branner ipa praat sil typst xsampa
Last synced: about 1 month ago
JSON representation
🔄 ASCII / IPA conversion for Typst
- Host: GitHub
- URL: https://github.com/imatpot/typst-ascii-ipa
- Owner: imatpot
- License: mit
- Created: 2023-03-23T18:11:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-13T23:31:35.000Z (4 months ago)
- Last Synced: 2024-07-16T17:05:54.596Z (about 2 months ago)
- Topics: branner, ipa, praat, sil, typst, xsampa
- Language: Typst
- Homepage: https://typst.app/universe/package/ascii-ipa
- Size: 731 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-typst - typst-ipa - 🔄 ASCII / IPA conversion for Typst (Templates & Libraries / Linguistics)
README
# `ascii-ipa`
🔄 ASCII / IPA conversion for Typst
This package allows you to easily convert different ASCII representations of the International Phonetic Alphabet (IPA) to and from the IPA.
It also offers some minor utilities to make phonetic transcriptions easier to use overall.
The package is being maintained [here][repo].Note: This is an extended port of the [`ipa-translate`][ipa-translate] Rust crate by [tirimid][tirimid]'s conversion features into native Typst.
Most conversions are implemented according to [this Wikipedia article][ipa-wikipedia] which in turn relies of the official specifications of the respective ASCII representations.## Conversion
The package supports multiple ASCII representations for the IPA with one function each:
| Notation | Function name |
|----------|-----------------|
| Branner | `#branner(...)` |
| Praat | `#praat(...)` |
| SIL | `#sil(...)` |
| X-SAMPA | `#xsampa(...)` |They all return the converted value as a [`string`][typst-str] and accept the set of same parameters:
| Parameter | Type | Positional / Named | Default | Description |
|-----------|-----------------------|--------------------|---------|------------------------------------------------------------------------------------------------------------|
| `value` | [`string`][typst-str] | positional | | Main input to the function. Usually the transcription in the corresponsing ASCII-based notation. |
| `reverse` | [`bool`][typst-bool] | named | `false` | Reverses the conversion. Pass Unicode IPA into `value` to get the corresponsing ASCII-based notation back. |### Examples
All examples use the Swiss German word [⟨Chuchichäschtli⟩ [ˈχʊχːiˌχæʃːtlɪ]][chuchichäschtli] for the conversion.
```typst
#import "@preview/ascii-ipa:2.0.0": *// returns "ˈχʊχːiˌχæʃːtlɪ"
#branner("'XUX:i,Xae)S:tlI")// returns "'XUX:i,Xae)S:tlI"
#branner("ˈχʊχːiˌχæʃːtlɪ", reverse: true)// returns "ˈχʊχːiˌχæʃːtlɪ"
#praat("\\'1\\cf\\hs\\cf\\:f\\'2\\ae\\sh\\:ftl\\ic")// returns "\\'1\\cf\\hs\\cf\\:f\\'2\\ae\\sh\\:ftl\\ic"
#praat("ˈχʊχːiˌχæʃːtlɪ", reverse: true)// returns "ˈχʊχːiˌχæʃːtlɪ"
#sil("}x=u