summaryrefslogtreecommitdiff
path: root/decoder/decoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/decoder.h')
-rw-r--r--decoder/decoder.h16
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_;
};