Ejemplo n.º 1
0
 def test_inflect_4(self):
     rules = StemmingRuleSet()
     rules.add("foo", "A|B>C<D|E")
     rules.add("foo", "A|B>C<D|F", {"+bar"})
     rules.add("foo", "A|B>C<D|G", {"-bar"})
     self.assertEqual(sorted([
         r["base"] + r["ending"]
         for r in rules.inflect("FAB", "foo")]),
         ["FACE", "FACG"])
     self.assertEqual(sorted([
         r["base"] + r["ending"]
         for r in rules.inflect("FAB", "foo", {"bar"})]),
         ["FACE", "FACF"])
Ejemplo n.º 2
0
 def test_inflect_4(self):
     rules = StemmingRuleSet()
     rules.add("foo", "A|B>C<D|E")
     rules.add("foo", "A|B>C<D|F", {"+bar"})
     rules.add("foo", "A|B>C<D|G", {"-bar"})
     self.assertEqual(
         sorted([
             r["base"] + r["ending"] for r in rules.inflect("FAB", "foo")
         ]), ["FACE", "FACG"])
     self.assertEqual(
         sorted([
             r["base"] + r["ending"]
             for r in rules.inflect("FAB", "foo", {"bar"})
         ]), ["FACE", "FACF"])
Ejemplo n.º 3
0
 def test_inflect_1(self):
     rules = StemmingRuleSet()
     r = rules.add("foo", "A|B>C<D|E")
     result = rules.inflect("FAB", "foo")
     self.assertEqual(list(result), [{
         "base": "FA",
         "ending": "CE",
         "rule": r,
         "used_default": False,
     }])
Ejemplo n.º 4
0
 def test_inflect_1(self):
     rules = StemmingRuleSet()
     r = rules.add("foo", "A|B>C<D|E")
     result = rules.inflect("FAB", "foo")
     self.assertEqual(list(result), [{
         "base": "FA",
         "ending": "CE",
         "rule": r,
         "used_default": False,
     }])