예제 #1
0
 def test_predicative(self):
     # Assert the accuracy of the predicative algorithm ("belles" => "beau").
     from pattern.db import Datasheet
     i, n = 0, 0
     for pred, attr, tag in Datasheet.load(os.path.join(PATH, "corpora", "wordforms-fr-lexique.csv")):
         if tag == "a":
             if fr.predicative(attr) == pred:
                 i +=1
             n += 1
     self.assertTrue(float(i) / n > 0.95)
     print("pattern.fr.predicative()")
예제 #2
0
 def test_predicative(self):
     # Assert the accuracy of the predicative algorithm ("belles" => "beau").
     from pattern.db import Datasheet
     i, n = 0, 0
     for pred, attr, tag in Datasheet.load(os.path.join(PATH, "corpora", "wordforms-fr-lexique.csv")):
         if tag == "a":
             if fr.predicative(attr) == pred:
                 i +=1
             n += 1
     self.assertTrue(float(i) / n > 0.95)
     print "pattern.fr.predicative()"