From 90f4ede0eea7ec5b73e7167dde4fe590485dcd67 Mon Sep 17 00:00:00 2001 From: "philblunsom@gmail.com" Date: Tue, 29 Jun 2010 17:05:14 +0000 Subject: Added different executable for working with context models, changed input/output processing. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@53 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/pyp-topics/src/contexts_corpus.hh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gi/pyp-topics/src/contexts_corpus.hh') diff --git a/gi/pyp-topics/src/contexts_corpus.hh b/gi/pyp-topics/src/contexts_corpus.hh index bd0cd34c..9614e7e3 100644 --- a/gi/pyp-topics/src/contexts_corpus.hh +++ b/gi/pyp-topics/src/contexts_corpus.hh @@ -48,9 +48,6 @@ class SimpleBackoffGenerator : public BackoffGenerator { class ContextsCorpus : public Corpus { friend void read_callback(const ContextsLexer::PhraseContextsType&, void*); -public: - typedef boost::ptr_vector::const_iterator const_iterator; - public: ContextsCorpus() : m_backoff(new TermBackoff) {} virtual ~ContextsCorpus() {} @@ -62,9 +59,18 @@ public: return m_backoff; } + std::vector context2string(const WordID& id) const { + return m_dict.AsVector(id); + } + + const std::string& key(const int& i) const { + return m_keys.at(i); + } + private: TermBackoffPtr m_backoff; Dict m_dict; + std::vector m_keys; }; #endif // _CONTEXTS_CORPUS_HH -- cgit v1.2.3