Esempio n. 1
0
    def test_nogloss(self):
        xp = xigt_testfile('missing_line_tests.xml')
        xc = xc_load(xp)
        no_gloss = xc[0]

        self.assertRaises(NoGlossLineException, gloss_line, no_gloss)
        self.assertRaises(NoNormLineException, gloss_line, no_gloss)
Esempio n. 2
0
    def test_filter_gloss_not_present(self):
        xp = xigt_testfile('missing_line_tests.xml')
        xc = xc_load(xp)

        test_xc, ex, fail, succ = filter_xc(xc, require_gloss=True)
        self.assertEqual(len(test_xc), 2)

        test_xc, ex, fail, succ = filter_xc(xc, require_gloss=False)
        self.assertEqual(len(test_xc), 3)

        test_xc, ex, fail, succ = filter_xc(xc, require_gloss=True, require_trans=True)
        self.assertEqual(len(test_xc), 1)

        test_xc, ex, fail, succ = filter_xc(xc, require_aln=True)
        self.assertEqual(len(test_xc), 0)

        test_xc, ex, fail, succ = filter_xc(xc, require_trans=True)
        self.assertEqual(len(test_xc), 2)
Esempio n. 3
0
 def test_inst_2(self):
     xp = xigt_testfile('xigt-projection-tests.xml')
     xc = xc_load(xp)
     do_projection(**{ARG_INFILE:xp, 'aln_method':ARG_ALN_GIZA, ARG_OUTFILE:'/dev/null'})
Esempio n. 4
0
 def setUp(self):
     self.xp = xigt_testfile('multiple_alignments.xml')
     self.xc = xc_load(self.xp)
Esempio n. 5
0
 def setUp(self):
     self.xc = xc_load(xigt_testfile('word_align.xml'))
Esempio n. 6
0
 def setUp(self):
     path = xigt_testfile('multiple_line_tests.xml')
     self.xc = xc_load(path)
Esempio n. 7
0
 def setUp(self):
     self.path = xigt_testfile('deu_no_gloss_line.xml')
Esempio n. 8
0
 def setUp(self):
     self.xc = xc_load(xigt_testfile('no_raw.xml'))
Esempio n. 9
0
 def test_hanging(self):
     xp = xigt_testfile('hang_test.xml')
     def_enrich_args[ARG_INFILE] = xp
     enrich(**def_enrich_args)
Esempio n. 10
0
 def test_encoding(self):
     xp = xigt_testfile('encoding-error-test.xml')
     def_enrich_args[ARG_INFILE] = xp
     enrich(**def_enrich_args)