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

Method test_find_prepositions

test/test_en.py:407–431  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

405 print "pattern.en.parser.find_labels()"
406
407 def test_find_prepositions(self):
408 # Assert preposition tag annotation (PP + NP).
409 v = en.parser.find_prepositions([
410 ["", "", "NP"],
411 ["", "", "VP"],
412 ["", "", "PP"],
413 ["", "", "NP"],
414 ["", "", "NP"],])
415 self.assertEqual(v, [
416 ["", "", "NP", "O"],
417 ["", "", "VP", "O"],
418 ["", "", "PP", "B-PNP"],
419 ["", "", "NP", "I-PNP"],
420 ["", "", "NP", "I-PNP"]])
421 # Assert PNP's with consecutive PP's.
422 v = en.parse("The cat was looking at me from up on the roof with interest.", prepositions=True)
423 self.assertEqual(v,
424 "The/DT/B-NP/O cat/NN/I-NP/O " \
425 "was/VBD/B-VP/O looking/VBG/I-VP/O " \
426 "at/IN/B-PP/B-PNP me/PRP/B-NP/I-PNP " \
427 "from/IN/B-PP/B-PNP up/IN/I-PP/I-PNP on/IN/I-PP/I-PNP the/DT/B-NP/I-PNP roof/NN/I-NP/I-PNP " \
428 "with/IN/B-PP/B-PNP interest/NN/B-NP/I-PNP " \
429 "././O/O"
430 )
431 print "pattern.en.parser.find_prepositions()"
432
433 def test_find_lemmata(self):
434 # Assert lemmata for nouns and verbs.

Callers

nothing calls this directly

Calls 2

find_prepositionsMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected