Пример #1
0
 def test_rule3_utils(self):
     s = ut.Consonant(ut.Place.alveolar, ut.Manner.fricative, False, "s", False)
     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.AbstractVowel()], [ut.AbstractVowel()]
         ),
         th,
         dh,
     )
     pos = ut.Position(ut.Rank.inner, a, s)
     self.assertEqual(rule.can_apply(pos), False)
Пример #2
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)
Пример #3
0
 def test_rule5_utils(self):
     k = ut.Consonant(ut.Place.velar, ut.Manner.stop, False, "k", False)
     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, k, a)
     self.assertEqual(rule.can_apply(pos), False)