summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorarmatthews <armatthe@cmu.edu>2015-02-04 19:14:39 -0500
committerarmatthews <armatthe@cmu.edu>2015-02-04 19:14:39 -0500
commit9196fdba4f51df0497ed2782af50e4afe3f6547a (patch)
tree13c356961c8e082d3c556b9207ccd69ded76502a /decoder
parent71868c10c5930e2d74719ed5cfcbf863a1a4a866 (diff)
allow empty feature dictionaries
Diffstat (limited to 'decoder')
-rw-r--r--decoder/hg_io.cc5
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; }