File size: 721 Bytes
158b61b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
40
#pragma once
#include <string>
#include <vector>
#include "OnDiskWrapper.h"
#include "Phrase.h"
#include "SourcePhrase.h"
#include "Word.h"
#include "PhraseNode.h"


namespace OnDiskPt
{

class OnDiskQuery
{
private:
  OnDiskWrapper &m_wrapper;

public:

  OnDiskQuery(OnDiskWrapper &wrapper):m_wrapper(wrapper) {}

  void Tokenize(Phrase &phrase,
                const std::string &token,
                bool addSourceNonTerm,
                bool addTargetNonTerm);

  SourcePhrase Tokenize(const std::vector<std::string>& tokens);

  const PhraseNode *Query(const SourcePhrase& sourcePhrase);

  inline const PhraseNode *Query(const std::vector<std::string>& tokens) {
    return Query(Tokenize(tokens));
  }

};


}