diff options
Diffstat (limited to 'gi/pyp-topics/src/contexts_corpus.hh')
-rw-r--r-- | gi/pyp-topics/src/contexts_corpus.hh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gi/pyp-topics/src/contexts_corpus.hh b/gi/pyp-topics/src/contexts_corpus.hh new file mode 100644 index 00000000..e680cef5 --- /dev/null +++ b/gi/pyp-topics/src/contexts_corpus.hh @@ -0,0 +1,39 @@ +#ifndef _CONTEXTS_CORPUS_HH +#define _CONTEXTS_CORPUS_HH + +#include <vector> +#include <string> +#include <map> + +#include <boost/ptr_container/ptr_vector.hpp> + +#include "corpus.hh" +#include "contexts_lexer.h" +#include "../../../decoder/dict.h" + +//////////////////////////////////////////////////////////////// +// ContextsCorpus +//////////////////////////////////////////////////////////////// + +class ContextsCorpus : public Corpus { + friend void read_callback(const ContextsLexer::PhraseContextsType&, void*); + +public: + typedef boost::ptr_vector<Document>::const_iterator const_iterator; + +public: + ContextsCorpus() {} + virtual ~ContextsCorpus() {} + + unsigned read_contexts(const std::string &filename); + + TermBackoffPtr backoff_index() { + return m_backoff; + } + +private: + TermBackoffPtr m_backoff; + Dict m_dict; +}; + +#endif // _CONTEXTS_CORPUS_HH |