def test(self): """ class TestClone """ ph1 = PhoSegObject( ipa="tˈai̯˧˥papo" ) ph2 = ph1.clone() self.assertEqual( ph1.get_ipa_representation(), ph2.get_ipa_representation() ) ph1[0].onset[0].maindata[0]['length'].set_to_extralong() self.assertNotEqual( ph1.get_ipa_representation(), ph2.get_ipa_representation() )
def test_init_by_soundsnames(self): """ TestPhoseg.test_init_by_soundsnames """ # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ph_obj = PhoSegObject( soundsnames = ['voiced palatal approximant'] ) self.assertEqual( ph_obj.get_ipa_representation(), "j") # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ph_obj = PhoSegObject( soundsnames = \ ['low front unrounded to close front unrounded diphthong'] ) self.assertEqual( ph_obj.get_ipa_representation(), "ai̯") # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ph_obj = PhoSegObject( soundsnames = \ ['voiceless alveolar fricative', 'low front unrounded to close front unrounded diphthong'] ) self.assertEqual( ph_obj.get_ipa_representation(), "sai̯") # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ph_obj = PhoSegObject( soundsnames = \ ["voiceless alveolar to voiceless palatoalveolar affricate"] ) self.assertEqual( ph_obj.get_ipa_representation(), "t͡ʃ") # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ph_obj = PhoSegObject( soundsnames = ["voiced alveolar to voiced palatoalveolar affricate"] ) self.assertEqual( ph_obj.get_ipa_representation(), "d͡ʒ") # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ph_obj = PhoSegObject( soundsnames = ["voiceless alveolar to voiceless alveolar affricate"] ) self.assertEqual( ph_obj.get_ipa_representation(), "t͡s") # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ph_obj = PhoSegObject( soundsnames = ["open mid front unrounded to " \ "close back rounded diphthong"] ) self.assertEqual( ph_obj.get_ipa_representation(), "ɛu̯") # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ph_obj = PhoSegObject( soundsnames = ["extralong open mid front unrounded to " \ "close back rounded diphthong"] ) self.assertEqual( ph_obj.get_ipa_representation(), "ɛːu̯")