summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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; }