diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2012-07-20 00:46:10 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2012-07-20 00:46:10 -0400 |
commit | 09d085e16f31b36b1177b313ee54414eb29d9082 (patch) | |
tree | 9b718b8129790860052ac35524b66b1645df847c /decoder/decoder.h | |
parent | 30c3f2b7186e6dc19acb8856b280b8dd97d1f679 (diff) |
enable programmatic setting of grammar objects, cleanup of grammar handling
Diffstat (limited to 'decoder/decoder.h')
-rw-r--r-- | decoder/decoder.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/decoder/decoder.h b/decoder/decoder.h index 6b2f7b16..bef2ff5e 100644 --- a/decoder/decoder.h +++ b/decoder/decoder.h @@ -37,6 +37,8 @@ struct DecoderObserver { virtual void NotifyDecodingComplete(const SentenceMetadata& smeta); }; +struct Grammar; // TODO once the decoder interface is cleaned up, + // this should be somewhere else struct Decoder { Decoder(int argc, char** argv); Decoder(std::istream* config_file); @@ -54,8 +56,8 @@ struct Decoder { // add grammar rules (currently only supported by SCFG decoders) // that will be used on subsequent calls to Decode. rules should be in standard // text format. This function does NOT read from a file. - void SetSupplementalGrammar(const std::string& grammar); - void SetSentenceGrammarFromString(const std::string& grammar_str); + void AddSupplementalGrammar(boost::shared_ptr<Grammar> gp); + void AddSupplementalGrammarFromString(const std::string& grammar_string); private: boost::program_options::variables_map conf; boost::shared_ptr<DecoderImpl> pimpl_; |