blob: b9d031673de33912ca7b0ec1f58d8b736e87c61c (
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
40
41
|
#pragma once
#include <cstddef>
#include "moses/Syntax/RuleTable.h"
namespace Moses
{
class Phrase;
class TargetPhrase;
class TargetPhraseCollection;
class Word;
namespace Syntax
{
namespace S2T
{
// Base class for parser-specific trie types.
class RuleTrie : public RuleTable
{
public:
RuleTrie(const RuleTableFF *ff) : RuleTable(ff) {}
virtual bool HasPreterminalRule(const Word &) const = 0;
private:
friend class RuleTrieCreator;
virtual TargetPhraseCollection::shared_ptr
GetOrCreateTargetPhraseCollection(const Phrase &source,
const TargetPhrase &target,
const Word *sourceLHS) = 0;
virtual void SortAndPrune(std::size_t) = 0;
};
} // namespace S2T
} // namespace Syntax
} // namespace Moses
|