summaryrefslogtreecommitdiff
path: root/decoder/fst_translator.cc
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-10-19 15:23:31 -0400
committerChris Dyer <redpony@gmail.com>2014-10-19 15:23:31 -0400
commitb2d5b3da636cfbef53830245f1f5281add2a4b62 (patch)
tree60a061bd28ae7fee7e9020b2d28dc1deb28ee423 /decoder/fst_translator.cc
parent011a87cfe6d9cc702cb4a8a6d9a765556e460af9 (diff)
remove json hypergraph format
Diffstat (limited to 'decoder/fst_translator.cc')
-rw-r--r--decoder/fst_translator.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/decoder/fst_translator.cc b/decoder/fst_translator.cc
index 50e6adcc..fe28f4c6 100644
--- a/decoder/fst_translator.cc
+++ b/decoder/fst_translator.cc
@@ -27,11 +27,15 @@ struct FSTTranslatorImpl {
const vector<double>& weights,
Hypergraph* forest) {
bool composed = false;
- if (input.find("{\"rules\"") == 0) {
+ if (input.find("::forest::") == 0) {
istringstream is(input);
+ string header, fname;
+ is >> header >> fname;
+ ReadFile rf(fname);
+ if (!rf) { cerr << "Failed to open " << fname << endl; abort(); }
Hypergraph src_cfg_hg;
- if (!HypergraphIO::ReadFromJSON(&is, &src_cfg_hg)) {
- cerr << "Failed to read HG from JSON.\n";
+ if (!HypergraphIO::ReadFromBinary(rf.stream(), &src_cfg_hg)) {
+ cerr << "Failed to read HG.\n";
abort();
}
if (add_pass_through_rules) {