diff options
author | olivia.buzek <olivia.buzek@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-09 22:03:30 +0000 |
---|---|---|
committer | olivia.buzek <olivia.buzek@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-09 22:03:30 +0000 |
commit | d5105daa487d67752cd599267f74b7c8d502ef1e (patch) | |
tree | 8aecdff8b68fb901845a424862eb2ef9211e4e7b /extools | |
parent | 3eac13e1c9bb50fdec5fdfa2fb7004ab05646e73 (diff) |
Fixing backoff grammar.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@214 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'extools')
-rw-r--r-- | extools/extract.cc | 19 |
1 files changed, 6 insertions, 13 deletions
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<WordID> rhs_f_bkoff; + /*vector<WordID> rhs_f_bkoff; vector<WordID> rhs_e_bkoff; vector<pair<short,short> > 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); - } } } } |