MCPcopy Create free account
hub / github.com/clips/pattern / test_find_lemmata

Method test_find_lemmata

test/test_fr.py:138–153  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

136 v = fr.parser.parse("Parce que c'est comme ça.")
137
138 def test_find_lemmata(self):
139 # Assert lemmata for nouns, adjectives, verbs and determiners.
140 v = fr.parser.find_lemmata([
141 ["Les", "DT"], ["chats", "NNS"], ["noirs", "JJ"], ["s'", "PRP"], [u"étaient", "VB"], ["assis", "VB"],
142 ["sur", "IN"], ["le", "DT"], ["tapis", "NN"]])
143 self.assertEqual(v, [
144 ["Les", "DT", "le"],
145 ["chats", "NNS", "chat"],
146 ["noirs", "JJ", "noir"],
147 ["s'", "PRP", "se"],
148 [u"étaient", "VB", u"être"],
149 ["assis", "VB", "asseoir"],
150 ["sur", "IN", "sur"],
151 ["le", "DT", "le"],
152 ["tapis", "NN", "tapis"]])
153 print "pattern.fr.parser.find_lemmata()"
154
155 def test_parse(self):
156 # Assert parsed output with Penn Treebank II tags (slash-formatted).

Callers

nothing calls this directly

Calls 1

find_lemmataMethod · 0.45

Tested by

no test coverage detected