Skip to main content

talk/
lib.rs

1//! talk: a phonetic encoding. IPA to talk (ascii) to simple (readable) to
2//! machine (one 24-bit integer per sound).
3//!
4//! Everything is derived from three data files (in base/) and a double-array
5//! trie scan.
6//!
7//! ```
8//! assert_eq!(talk::ipa_to_talk("tʰa"), "t<h>a");
9//! assert_eq!(talk::talk_to_ipa("t<h>a"), "tʰa");
10//! assert_eq!(talk::readable("t<h>a"), "tʰa");
11//! assert_eq!(
12//!   talk::machine("t<h>a", talk::Notation::Tone, talk::Tier::Mesh).len(),
13//!   2
14//! );
15//! ```
16
17pub mod space;
18pub mod string;
19pub mod syllable;
20pub mod trie;
21
22pub use string::combine::combine;
23pub use space::axis::{Attachment, MarkGroup, attaches, ipa_axes};
24pub use space::codec::{
25  Composition, byte_width, decode_unit, encode_unit, machine, machine_bytes,
26  machine_text, pack, size_of, unpack,
27};
28pub use space::count::{
29  Space, bytes_for, capacity, count_attested, count_space, unit_for,
30};
31pub use space::model::{
32  Model, ModelAxis, ModelBase, Notation, Tier, axes_for, model_for,
33};
34pub use string::normalize::{normalize_ipa, normalize_ipa_with, NormalizeIpaOptions};
35pub use string::convert::{
36  ipa_to_talk, parse_ipa, readable, talk_to_ipa, tokenize, IpaUnit,
37};
38pub use string::enumerate::enumerate_sounds;
39pub use string::sound::{make_sound, segment};
40pub use string::types::{
41  CODE_LIMIT, NO_CODE,
42  Attaches, Form, Kind, Modifier, Phone, Sound, SoundInfo, SymbolEntry, Unit,
43};
44pub use syllable::{
45  chunk, cluster, group_clusters_into_syllables, group_segments_into_clusters, read_segments,
46  serialize, syllables, Chunked, Cluster, ClusterKey, Error, Segment, SegmentKind, Syllable, Tone,
47};