2012-11-14 21:14:46 +04:00
|
|
|
#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:
|
|
|
|
|
2013-05-29 21:16:15 +04:00
|
|
|
OnDiskQuery(OnDiskWrapper &wrapper):m_wrapper(wrapper) {}
|
|
|
|
|
|
|
|
void Tokenize(Phrase &phrase,
|
|
|
|
const std::string &token,
|
|
|
|
bool addSourceNonTerm,
|
|
|
|
bool addTargetNonTerm);
|
2012-11-14 21:14:46 +04:00
|
|
|
|
|
|
|
SourcePhrase Tokenize(const std::vector<std::string>& tokens);
|
|
|
|
|
|
|
|
const PhraseNode *Query(const SourcePhrase& sourcePhrase);
|
|
|
|
|
2013-05-29 21:16:15 +04:00
|
|
|
inline const PhraseNode *Query(const std::vector<std::string>& tokens) {
|
2012-11-14 21:14:46 +04:00
|
|
|
return Query(Tokenize(tokens));
|
|
|
|
}
|
2013-05-29 21:16:15 +04:00
|
|
|
|
2012-11-14 21:14:46 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|