diff options
author | Chris Dyer <redpony@gmail.com> | 2014-04-25 02:01:59 -0400 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2014-04-25 02:01:59 -0400 |
commit | 4078d043bb3d3ebc386af44f6e1af3036f0afc25 (patch) | |
tree | 3938dde9c98c9ad430d285c1c078b97f826ab3f4 /training/utils | |
parent | 2af1d21b74343b568fbb87a2a6902ee01f19636a (diff) |
support for multiple xRs states in parser (not yet in rules)
Diffstat (limited to 'training/utils')
-rw-r--r-- | training/utils/grammar_convert.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/training/utils/grammar_convert.cc b/training/utils/grammar_convert.cc index 607a7cb9..58d1957c 100644 --- a/training/utils/grammar_convert.cc +++ b/training/utils/grammar_convert.cc @@ -292,10 +292,10 @@ int main(int argc, char **argv) { int lc = 0; Hypergraph hg; map<WordID, int> lhs2node; + string line; while(*in) { - string line; + getline(*in,line); ++lc; - getline(*in, line); if (is_json_input) { if (line.empty() || line[0] == '#') continue; string ref; @@ -342,6 +342,7 @@ int main(int argc, char **argv) { edge->feature_values_ = tr->scores_; Hypergraph::Node* node = &hg.nodes_[head]; hg.ConnectEdgeToHeadNode(edge, node); + node->node_hash = lc; } } } |