diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-19 19:52:07 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-19 19:52:07 +0000 |
commit | b95e56adb2197ccc8ff60b4015c020011009d14c (patch) | |
tree | 89acb95777c0eeca7fc9243507ad100fe4ad7e82 /decoder/decoder.h | |
parent | 3e9de500d461fa9813295664b847d217f1e8f865 (diff) |
big refactor
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@649 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/decoder.h')
-rw-r--r-- | decoder/decoder.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/decoder/decoder.h b/decoder/decoder.h index ae1b9bb0..5dd6e1aa 100644 --- a/decoder/decoder.h +++ b/decoder/decoder.h @@ -5,17 +5,29 @@ #include <string> #include <vector> #include <boost/shared_ptr.hpp> +#include <boost/program_options/variables_map.hpp> +class SentenceMetadata; struct Hypergraph; struct DecoderImpl; + +struct DecoderObserver { + virtual void NotifySourceParseFailure(const SentenceMetadata& smeta); + virtual void NotifyTranslationForest(const SentenceMetadata& smeta, Hypergraph* hg); + virtual void NotifyAlignmentFailure(const SentenceMetadata& semta); + virtual void NotifyAlignmentForest(const SentenceMetadata& smeta, Hypergraph* hg); + virtual void NotifyDecodingComplete(const SentenceMetadata& smeta); +}; + struct Decoder { Decoder(int argc, char** argv); Decoder(std::istream* config_file); - bool Decode(const std::string& input); - bool DecodeProduceHypergraph(const std::string& input, Hypergraph* hg); + bool Decode(const std::string& input, DecoderObserver* observer = NULL); void SetWeights(const std::vector<double>& weights); ~Decoder(); + const boost::program_options::variables_map& GetConf() const { return conf; } private: + boost::program_options::variables_map conf; boost::shared_ptr<DecoderImpl> pimpl_; }; |