summaryrefslogtreecommitdiff
path: root/gi/pyp-topics/src/contexts_corpus.hh
blob: e680cef566b058d1d36130ad94a324c9c9234147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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