From 9196fdba4f51df0497ed2782af50e4afe3f6547a Mon Sep 17 00:00:00 2001 From: armatthews Date: Wed, 4 Feb 2015 19:14:39 -0500 Subject: allow empty feature dictionaries --- decoder/hg_io.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3