summaryrefslogtreecommitdiff
path: root/gi/pf/ngram_base.h
blob: 4ea999f32fe196336300726ba58ddb2d4f942b33 (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
#ifndef _NGRAM_BASE_H_
#define _NGRAM_BASE_H_

#include <string>
#include <vector>
#include "trule.h"
#include "wordid.h"
#include "prob.h"

struct FixedNgramBaseImpl;
struct FixedNgramBase {
  FixedNgramBase(const std::string& lmfname);
  ~FixedNgramBase();
  prob_t StringProbability(const std::vector<WordID>& s) const;

  prob_t operator()(const TRule& rule) const {
    return StringProbability(rule.e_);
  }

 private:
  FixedNgramBaseImpl* impl;

};

#endif