summaryrefslogtreecommitdiff
path: root/training/utils/grammar_convert.cc
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-04-25 02:01:59 -0400
committerChris Dyer <redpony@gmail.com>2014-04-25 02:01:59 -0400
commitc5531cdbcecb6e902ab08c9297f16f03b829497f (patch)
treed53af807fbceda0032c5929a4b79e9d994a26fcf /training/utils/grammar_convert.cc
parent97ee2a6f856c211a37a1c99b031319bff7dbee1c (diff)
support for multiple xRs states in parser (not yet in rules)
Diffstat (limited to 'training/utils/grammar_convert.cc')
-rw-r--r--training/utils/grammar_convert.cc5
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;
}
}
}