diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-02 04:34:33 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-02 04:34:33 +0000 |
commit | 187f6c1cd2849c2bbbdcf02e86f0ef591364620e (patch) | |
tree | b0843ca15ceddbb9e14c19ffe56407cfc6cae88f /decoder/hg_io.cc | |
parent | e829eb7cc9573029caa59e295aca50dad3e26a4a (diff) |
deal with samt cats
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@101 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/hg_io.cc')
-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 5161931d..6a5561e6 100644 --- a/decoder/hg_io.cc +++ b/decoder/hg_io.cc @@ -332,7 +332,10 @@ bool HypergraphIO::WriteToJSON(const Hypergraph& hg, bool remove_rules, ostream* o << (j == 0 ? "" : ",") << mapped_edge; } o << "]"; - if (node.cat_ < 0) { o << ",\"cat\":\"" << TD::Convert(node.cat_ * -1) << '"'; } + if (node.cat_ < 0) { + o << ",\"cat\":"; + JSONParser::WriteEscapedString(TD::Convert(node.cat_ * -1), &o); + } o << "}"; } o << "}\n"; |