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 | 5b172f92a06eb9b946ddd6f4e2a1b22a12ca65dd (patch) | |
tree | 7763b947da74c61a9a65ce801442a3889d5c790b /decoder | |
parent | bda62d4df45b1321059b7e3a7cac7777fd83b435 (diff) |
allow empty feature dictionaries
Diffstat (limited to 'decoder')
-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; } |