diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-10-05 17:33:45 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-10-05 17:33:45 +0000 |
commit | 1f2cd493ce212feab41f74e180063c1987511d00 (patch) | |
tree | 0539ad3fe72b7398b05f6356dfa42bb25d472588 /decoder/sentence_metadata.h | |
parent | de3b20fd379a62f8f381990f4d819a732b57a814 (diff) |
add PrepareForInput to ff interface, make sgml markup available to feature functions
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@669 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/sentence_metadata.h')
-rw-r--r-- | decoder/sentence_metadata.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/decoder/sentence_metadata.h b/decoder/sentence_metadata.h index c9a78dd3..eab9f15d 100644 --- a/decoder/sentence_metadata.h +++ b/decoder/sentence_metadata.h @@ -1,11 +1,14 @@ #ifndef _SENTENCE_METADATA_H_ #define _SENTENCE_METADATA_H_ +#include <string> +#include <map> #include <cassert> #include "lattice.h" #include "scorer.h" struct SentenceMetadata { + friend class DecoderImpl; SentenceMetadata(int id, const Lattice& ref) : sent_id_(id), src_len_(-1), @@ -42,7 +45,14 @@ struct SentenceMetadata { const DocScorer& GetDocScorer() const { return *ds; } double GetDocLen() const {return doc_len;} + std::string GetSGMLValue(const std::string& key) const { + std::map<std::string, std::string>::const_iterator it = sgml_.find(key); + if (it == sgml_.end()) return ""; + return it->second; + } + private: + std::map<std::string, std::string> sgml_; const int sent_id_; // the following should be set, if possible, by the Translator int src_len_; |