コード例 #1
0
ファイル: test_corpus.py プロジェクト: rafael2reis/corpus
    def testNext(self):
        c = CorpusAd("bosque/Bosque_CF_8.0.ad.txt")

        p = c.next()
        c.next()
        c.next()
        c.next()

        self.assertNotEqual(p, None)
コード例 #2
0
ファイル: test_corpus.py プロジェクト: rafael2reis/corpus
    def testNodeNextPrevious2(self):
        c = CorpusAd("bosque/Bosque_CF_8.0.ad.txt")
        c.next()
        p = c.next()

        node = p.nodes[18]
        i = 0
        while node.next:
            print("|", node.next.txt, "|", node.next.level, node.next.stype)
            node = node.next
            i += 1

        self.assertEqual(i, 5)
コード例 #3
0
def annotate():
    speechVerbs = SpeechVerbs()
    c = CorpusAd("bosque/Bosque_CP_8.0.ad.txt", speechVerbs)

    p = c.next()
    while p:
        #f = findPattern(p, speechVerbs, pattern3)
        #f = findPattern(p, speechVerbs, pattern1)
        #f = findPattern(p, speechVerbs, pattern3NoSubj)
        #f = findPattern(p, speechVerbs, pattern2)
        #f = findPattern(p, speechVerbs, pattern7)
        #f = findPattern5(p, speechVerbs, pattern5)
        f = findPattern6(p, speechVerbs, pattern6)

        p = c.next()