Crates.io | ipa-translate |
lib.rs | ipa-translate |
version | 0.2.0 |
source | src |
created_at | 2022-11-05 17:22:20.812792 |
updated_at | 2023-10-17 14:17:09.746137 |
description | A crate for translating between IPA and ASCII text |
homepage | |
repository | https://github.com/tirimid/ipa-translate |
max_upload_size | |
id | 705951 |
size | 25,660 |
A crate for translating between IPA and ASCII text.
use ipa_translate;
fn main() {
let ipa = "prʲɪvʲet";
let xsampa = "pr_jIv_jet";
let praat = r"pr\^j\icv\^jet";
let branner = "prj^Ivj^et";
let sil = "prj^i=vj^et";
// forward translation.
assert_eq!(ipa_translate::xsampa_to_ipa(xsampa), ipa);
assert_eq!(ipa_translate::praat_to_ipa(praat), ipa);
assert_eq!(ipa_translate::branner_to_ipa(branner), ipa);
assert_eq!(ipa_translate::sil_to_ipa(sil), ipa);
// inverse translation.
assert_eq!(ipa_translate::ipa_to_xsampa(ipa), xsampa);
assert_eq!(ipa_translate::ipa_to_praat(ipa), praat);
assert_eq!(ipa_translate::ipa_to_branner(ipa), branner);
assert_eq!(ipa_translate::ipa_to_sil(ipa), sil);
}