use ipa_translate; #[test] fn english_phonemes() { let phonemes = vec![ ("i=i:u:o=aa=:", "ɪiːʊuːɔːeɛːəɜːɒæʌɑː"), ("mnn>", "mnŋ"), ("ptts=kbddz=g<", "pttʃkbddʒɡ"), ("ft=ss=xvd=zz=h", "fθsʃxvðzʒh"), ("lrjw", "lrjw"), ]; for group in phonemes { assert_eq!(ipa_translate::sil_to_ipa(group.0), group.1); assert_eq!(ipa_translate::ipa_to_sil(group.1), group.0); } } #[test] fn russian_phonemes() { let phonemes = vec![ ("iI=ueoa", "iɨueoa"), ("mmj^nnj^", "mmʲnnʲ"), ("ppj^ttj^kkj^bbj^ddj^g:g=", "ffʲssʲʂɕːxxʲvvʲzzʲʐʑːɣ"), ("l~~lj^j", "ɫlʲj"), ("rj^r", "rʲr"), ]; for group in phonemes { assert_eq!(ipa_translate::sil_to_ipa(group.0), group.1); assert_eq!(ipa_translate::ipa_to_sil(group.1), group.0); } } #[test] fn arabic_phonemes() { let phonemes = vec![ ("iui:u:aa:awaj", "iuiːuːaaːawaj"), ("ptt?<^kq?=bdd?<^dz=g<", "pttˤkqʔbddˤdʒɡ"), ("ft=ss?<^s=xx=h>hvd=zd=?<^z?<^g=R>?<", "fθssˤʃxχħhvðzðˤzˤɣʁʕ"), ("mn", "mn"), ("r", "r"), ("ll~~jw", "lɫjw"), ]; for group in phonemes { assert_eq!(ipa_translate::sil_to_ipa(group.0), group.1); assert_eq!(ipa_translate::ipa_to_sil(group.1), group.0); } }