diff options
Diffstat (limited to 'decoder/hg_cfg.h')
-rwxr-xr-x | decoder/hg_cfg.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/decoder/hg_cfg.h b/decoder/hg_cfg.h index ba936990..b90aca47 100755 --- a/decoder/hg_cfg.h +++ b/decoder/hg_cfg.h @@ -7,8 +7,12 @@ class Hypergraph; // in case you might want the CFG whether or not you apply FSA models: struct HgCFG { - HgCFG(Hypergraph const& ih) : ih(ih) { + void set_defaults() { have_cfg=binarized=have_features=uniqed=false; + want_features=true; + } + HgCFG(Hypergraph const& ih) : ih(ih) { + set_defaults(); } Hypergraph const& ih; CFG cfg; @@ -32,11 +36,14 @@ struct HgCFG { if (!have_cfg) InitCFG(to); else { + cfg.VisitRuleIds(*this); have_cfg=false; to.Clear(); - to.Swap(cfg); + swap(to,cfg); } } + void operator()(int ri) const { + } CFG const& GetCFG() const { assert(have_cfg); return cfg; |