diff options
author | armatthews <armatthe@cmu.edu> | 2015-02-04 19:14:39 -0500 |
---|---|---|
committer | armatthews <armatthe@cmu.edu> | 2015-02-04 19:14:39 -0500 |
commit | 9196fdba4f51df0497ed2782af50e4afe3f6547a (patch) | |
tree | 13c356961c8e082d3c556b9207ccd69ded76502a | |
parent | 71868c10c5930e2d74719ed5cfcbf863a1a4a866 (diff) |
allow empty feature dictionaries
-rw-r--r-- | decoder/hg_io.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/decoder/hg_io.cc b/decoder/hg_io.cc index 59d0b851..71f50a29 100644 --- a/decoder/hg_io.cc +++ b/decoder/hg_io.cc @@ -207,7 +207,10 @@ void ReadPLFEdge(const std::string& in, int &c, int cur_node, Hypergraph* hg) { // Read in sparse feature format if (get(in,c) == '{') { c++; - ReadPLFFeature(in, c, features); + eatws(in,c); + if (get(in,c) != '}') { + ReadPLFFeature(in, c, features); + } while (get(in,c) == ',') { c++; if (get(in,c) == '}') { break; } |