diff options
author | Chris Dyer <prguest11@taipan.cs> | 2012-02-27 02:19:34 +0000 |
---|---|---|
committer | Chris Dyer <prguest11@taipan.cs> | 2012-02-27 02:19:34 +0000 |
commit | d87220030b82fed860efee40487502e9ee8f0651 (patch) | |
tree | 8ec678dc91597dbf2863deb85165bb132103327b /decoder | |
parent | 9007216a43c5572c2c343a1700ac79fb35b7d82f (diff) |
generic bayesian cfg learner with a bunch of cfg grammar types
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/trule.cc | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/decoder/trule.cc b/decoder/trule.cc index 40235542..141b8faa 100644 --- a/decoder/trule.cc +++ b/decoder/trule.cc @@ -232,16 +232,6 @@ void TRule::ComputeArity() { arity_ = 1 - min; } -static string AnonymousStrVar(int i) { - string res("[v]"); - if(!(i <= 0 && i >= -8)) { - cerr << "Can't handle more than 9 non-terminals: index=" << (-i) << endl; - abort(); - } - res[1] = '1' - i; - return res; -} - string TRule::AsString(bool verbose) const { ostringstream os; int idx = 0; @@ -259,15 +249,11 @@ string TRule::AsString(bool verbose) const { } } os << " ||| "; - if (idx > 9) { - cerr << "Too many non-terminals!\n partial: " << os.str() << endl; - exit(1); - } for (int i =0; i<e_.size(); ++i) { if (i) os << ' '; const WordID& w = e_[i]; if (w < 1) - os << AnonymousStrVar(w); + os << '[' << (1-w) << ']'; else os << TD::Convert(w); } |