示例#1
0
def wordvarieties(word):
    lem = lemma(word)
    pre = predicative(word)
    att = attributive(word)
    sin = singularize(word)
    con = conjugate(word, PRESENT, 1, SG)
    return [lem, pre, att, sin, con]
示例#2
0
 def test_attributive(self):
     # Assert the accuracy of the attributive algorithm ("fel" => "felle").
     from pattern.db import Datasheet
     i, n = 0, 0
     for pred, attr, sg, pl in Datasheet.load(os.path.join(PATH, "corpora", "wordforms-nl-celex.csv")):
         if nl.attributive(pred) == attr:
             i += 1
         n += 1
     self.assertTrue(float(i) / n > 0.96)
     print("pattern.nl.attributive()")
示例#3
0
 def test_attributive(self):
     # Assert the accuracy of the attributive algorithm ("fel" => "felle").
     from pattern.db import Datasheet
     i, n = 0, 0
     for pred, attr, sg, pl in Datasheet.load(os.path.join(PATH, "corpora", "wordforms-nl-celex.csv")):
         if nl.attributive(pred) == attr:
             i +=1
         n += 1
     self.assertTrue(float(i) / n > 0.96)
     print "pattern.nl.attributive()"