From 95260b8dcf23fc315e2ea1c62f46c07681783d42 Mon Sep 17 00:00:00 2001 From: Jack Gerrits Date: Tue, 15 Jan 2019 17:21:13 -0500 Subject: [PATCH] Add check for hash_inv when creating json parser (#1711) --- vowpalwabbit/parser.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vowpalwabbit/parser.cc b/vowpalwabbit/parser.cc index a3cbd01a654..e1b0d2d90e8 100644 --- a/vowpalwabbit/parser.cc +++ b/vowpalwabbit/parser.cc @@ -642,7 +642,8 @@ void enable_sources(vw& all, bool quiet, size_t passes) if (all.opts_n_args.vm.count("json") || all.opts_n_args.vm.count("dsjson")) { // TODO: change to class with virtual method - if (all.audit) + // --invert_hash requires the audit parser version to save the extra information. + if (all.audit || all.hash_inv) { all.p->reader = &read_features_json; all.p->audit = true;