summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorChris Dyer <prguest11@taipan.cs>2012-02-27 02:19:34 +0000
committerChris Dyer <prguest11@taipan.cs>2012-02-27 02:19:34 +0000
commitdc2b2fc395ad496851f723c4da59181445c07047 (patch)
tree7774b4a528ae467abfc702d9a7f6510f60cb3b48 /decoder
parente279f1fd267bc18763fa8ff456462c5e677689e9 (diff)
generic bayesian cfg learner with a bunch of cfg grammar types
Diffstat (limited to 'decoder')
-rw-r--r--decoder/trule.cc16
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);
}