def evaluate_statistic_methods_on_file(f, xc, mas, classifier_obj, tagger, lang, pool=None, lock=None): """ :type xc: RGCorpus :type mas: MultAlignScorer """ heur_align_corp(xc) giza_align_l_t(xc) mas.add_corpus('lang_trans', INTENT_ALN_GIZA, lang, xc, lang_trans=True) remove_alignments(xc, INTENT_ALN_GIZA) giza_align_l_t(xc, use_heur=True) mas.add_corpus('lang_trans_heur', INTENT_ALN_GIZA, lang, xc, lang_trans=True) remove_alignments(xc, INTENT_ALN_GIZA) giza_align_t_g(xc, aligner=ALIGNER_FASTALIGN, use_heur=False) mas.add_corpus('fast_align', INTENT_ALN_GIZA, lang, xc) remove_alignments(xc, INTENT_ALN_GIZA) giza_align_t_g(xc, aligner=ALIGNER_FASTALIGN, use_heur=True) mas.add_corpus('fast_align_heur', INTENT_ALN_GIZAHEUR, lang, xc) remove_alignments(xc, INTENT_ALN_GIZAHEUR) giza_align_t_g(xc, use_heur=False, resume=False) mas.add_corpus('statistic', INTENT_ALN_GIZA, lang, xc) remove_alignments(xc, INTENT_ALN_GIZA) giza_align_t_g(xc, use_heur=True, resume=False) mas.add_corpus('statistic_heur', INTENT_ALN_GIZAHEUR, lang, xc) remove_alignments(xc, INTENT_ALN_GIZAHEUR) giza_align_t_g(xc, use_heur=False, resume=True) mas.add_corpus('statistic+', INTENT_ALN_GIZA, lang, xc) remove_alignments(xc, INTENT_ALN_GIZA) giza_align_t_g(xc, use_heur=True, resume=True) mas.add_corpus('statistic+_heur', INTENT_ALN_GIZAHEUR, lang, xc) remove_alignments(xc, INTENT_ALN_GIZAHEUR)
def heur_align_test(self): new_c = copy_xigt(self.xc) heur_align_corp(new_c) aln = get_trans_glosses_alignment(new_c[0], aln_method=INTENT_ALN_HEUR) a = Alignment([(5, 7), (6, 5), (1, 1), (4, 3)]) self.assertEquals(a, aln)