Esempio n. 1
0
 def slurp_subcorpus(self, cfiles, verbose=False):
     """
     See `educe.rst_dt.parse` for a description of `RSTTree`
     """
     corpus={}
     counter=0
     for k in cfiles.keys():
         if verbose:
             sys.stderr.write("\rSlurping corpus dir [%d/%d]" % (counter, len(cfiles)))
         f = cfiles[k]
         annotations=parse.parse(f)
         #annotations.set_origin(k)
         corpus[k]=annotations
         counter=counter+1
     if verbose:
         sys.stderr.write("\rSlurping corpus dir [%d/%d done]\n" % (counter, len(cfiles)))
     return corpus
Esempio n. 2
0
 def test_all(self):
     for path in glob.glob('tests/*.pdtb'):
         for rel in p.parse(path):
             xml = x.Relation_xml(rel)
             self.assertEqual(rel, x.read_Relation(xml))
Esempio n. 3
0
 def test(self):
     for path in glob.glob('tests/*.pdtb'):
         xs = p.parse(path)
         self.assertNotEquals(0, len(xs))
Esempio n. 4
0
 def test_all(self):
     for path in glob.glob('tests/*.pdtb'):
         for rel in p.parse(path):
             xml = x.Relation_xml(rel)
             self.assertEqual(rel, x.read_Relation(xml))
Esempio n. 5
0
 def test(self):
     for path in glob.glob('tests/*.pdtb'):
         xs = p.parse(path)
         self.assertNotEquals(0, len(xs))