From 6211d023c559f3969ac0a827f4635c5b0959f230 Mon Sep 17 00:00:00 2001 From: "olivia.buzek" Date: Fri, 9 Jul 2010 22:03:30 +0000 Subject: Fixing backoff grammar. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@214 ec762483-ff6d-05da-a07a-a48fb63a330f --- extools/extract.cc | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'extools') diff --git a/extools/extract.cc b/extools/extract.cc index c2c413e2..14497089 100644 --- a/extools/extract.cc +++ b/extools/extract.cc @@ -283,7 +283,7 @@ void Extract::ExtractConsistentRules(const AnnotatedParallelSentence& sentence, for (short j = 0; j < cur_es.size(); ++j) if (cur_es[j] >= 0 && sentence.aligned(cur_fs[i],cur_es[j])) cur_terminal_align.push_back(make_pair(i,j)); - observer->CountRule(lhs, cur_rhs_f, cur_rhs_e, cur_terminal_align); + //observer->CountRule(lhs, cur_rhs_f, cur_rhs_e, cur_terminal_align); if(!all_cats->empty()) { //produce the backoff grammar if the category wordIDs are available @@ -294,7 +294,7 @@ void Extract::ExtractConsistentRules(const AnnotatedParallelSentence& sentence, nonterm+=bkoff_mrkr; bkoff = -TD::Convert(nonterm); cur_rhs_f[i]=bkoff; - vector rhs_f_bkoff; + /*vector rhs_f_bkoff; vector rhs_e_bkoff; vector > bkoff_align; bkoff_align.clear(); @@ -307,19 +307,12 @@ void Extract::ExtractConsistentRules(const AnnotatedParallelSentence& sentence, rhs_e_bkoff.push_back(0); observer->CountRule(bkoff,rhs_f_bkoff,rhs_e_bkoff,bkoff_align); - } - }//else - //cerr << cur_rhs_f[i] << ": (words,f) |" << TD::Convert(cur_rhs_f[i]) << endl; + }*/ + } } - /*for (int i=0; i < cur_rhs_e.size(); ++i) - if(cur_rhs_e[i] <= 0) - cerr << cur_rhs_e[i] << ": (cats,e) |" << TD::Convert(1-cur_rhs_e[i]) << endl; - else - cerr << cur_rhs_e[i] << ": (words,e) |" << TD::Convert(cur_rhs_e[i]) << endl; - */ - + + } observer->CountRule(lhs, cur_rhs_f, cur_rhs_e, cur_terminal_align); - } } } } -- cgit v1.2.3