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)
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)
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'})
def setUp(self): self.xp = xigt_testfile('multiple_alignments.xml') self.xc = xc_load(self.xp)
def setUp(self): self.xc = xc_load(xigt_testfile('word_align.xml'))
def setUp(self): path = xigt_testfile('multiple_line_tests.xml') self.xc = xc_load(path)
def setUp(self): self.path = xigt_testfile('deu_no_gloss_line.xml')
def setUp(self): self.xc = xc_load(xigt_testfile('no_raw.xml'))
def test_hanging(self): xp = xigt_testfile('hang_test.xml') def_enrich_args[ARG_INFILE] = xp enrich(**def_enrich_args)
def test_encoding(self): xp = xigt_testfile('encoding-error-test.xml') def_enrich_args[ARG_INFILE] = xp enrich(**def_enrich_args)