Пример #1
0
 def test_rule7_utils(self):
     b = ut.Consonant(ut.Place.bilabial, ut.Manner.stop, True, "b", False)
     th = ut.Consonant(ut.Place.dental, ut.Manner.fricative, False, "θ", False)
     dh = ut.Consonant(ut.Place.dental, ut.Manner.fricative, True, "ð", False)
     rule = ut.Rule(ut.AbstractPosition(ut.Rank.inner, [ut.AbstractConsonant(voiced=True)],
                                        [ut.AbstractConsonant(voiced=True)]), th, dh)
     pos = ut.Position(ut.Rank.inner, b, b)
     self.assertEqual(rule.can_apply(pos), True)
Пример #2
0
 def test_rule4_utils(self):
     a = ut.Vowel(ut.Height.open, ut.Backness.front, False, ut.Length.short, "a")
     th = ut.Consonant(ut.Place.dental, ut.Manner.fricative, False, "θ", False)
     dh = ut.Consonant(ut.Place.dental, ut.Manner.fricative, True, "ð", False)
     rule = ut.Rule(ut.AbstractPosition(ut.Rank.inner, [ut.AbstractConsonant(voiced=True)],
                                         [ut.AbstractConsonant(voiced=True)]), th, dh)
     pos = ut.Position(ut.Rank.inner, a, a)
     self.assertEqual(rule.can_apply(pos), False)
Пример #3
0
 def test_rule4_utils(self):
     a = ut.Vowel("open", "front", False, "short", "a")
     th = ut.Consonant("dental", "frictative", False, "θ", False)
     dh = ut.Consonant("dental", "frictative", True, "ð", False)
     rule = ut.Rule(
         ut.AbstractPosition("inner", [ut.AbstractConsonant(voiced=True)],
                             [ut.AbstractConsonant(voiced=True)]), th, dh)
     pos = ut.Position("inner", a, a)
     self.assertEqual(rule.can_apply(pos), False)
Пример #4
0
 def test_rule7_utils(self):
     b = ut.Consonant("bilabial", "stop", True, "b", False)
     th = ut.Consonant("dental", "frictative", False, "θ", False)
     dh = ut.Consonant("dental", "frictative", True, "ð", False)
     rule = ut.Rule(
         ut.AbstractPosition("inner", [ut.AbstractConsonant(voiced=True)],
                             [ut.AbstractConsonant(voiced=True)]), th, dh)
     pos = ut.Position("inner", b, b)
     self.assertEqual(rule.can_apply(pos), True)
Пример #5
0
 def test_rule2_utils(self):
     k = ut.Consonant("velar", "stop", False, "k", False)
     a = ut.Vowel("open", "front", False, "short", "a")
     th = ut.Consonant("dental", "frictative", False, "θ", False)
     dh = ut.Consonant("dental", "frictative", True, "ð", False)
     rule = ut.Rule(
         ut.AbstractPosition("inner", [ut.AbstractVowel()],
                             [ut.AbstractVowel()]), th, dh)
     pos = ut.Position("inner", k, a)
     self.assertEqual(rule.can_apply(pos), False)