ipa-translate

Crates.ioipa-translate
lib.rsipa-translate
version0.2.0
sourcesrc
created_at2022-11-05 17:22:20.812792
updated_at2023-10-17 14:17:09.746137
descriptionA crate for translating between IPA and ASCII text
homepage
repositoryhttps://github.com/tirimid/ipa-translate
max_upload_size
id705951
size25,660
(tirimid)

documentation

README

ipa-translate

A crate for translating between IPA and ASCII text.

Usage

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);
}
Commit count: 19

cargo fmt