From ad307cc72c80f9fc81affe8723682b685f60914f Mon Sep 17 00:00:00 2001 From: redpony Date: Sun, 19 Sep 2010 19:52:07 +0000 Subject: big refactor git-svn-id: https://ws10smt.googlecode.com/svn/trunk@649 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/decoder.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'decoder/decoder.h') 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 #include #include +#include +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& weights); ~Decoder(); + const boost::program_options::variables_map& GetConf() const { return conf; } private: + boost::program_options::variables_map conf; boost::shared_ptr pimpl_; }; -- cgit v1.2.3