Welcome to mirror list, hosted at ThFree Co, Russian Federation.

RuleTrieCreator.h « S2T « Syntax « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 62da519a1a8ad5630c48519d08357b29db3f3655 (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
#pragma once

#include "RuleTrie.h"

namespace Moses
{
namespace Syntax
{
namespace S2T
{

// Base for classes that create a RuleTrie (currently RuleTrieLoader and
// OovHandler).  RuleTrieCreator is a friend of RuleTrie.
class RuleTrieCreator
{
protected:
  // Provide access to RuleTrie's private SortAndPrune function.
  void SortAndPrune(RuleTrie &trie, std::size_t limit) {
    trie.SortAndPrune(limit);
  }

  // Provide access to RuleTrie's private GetOrCreateTargetPhraseCollection
  // function.
  TargetPhraseCollection::shared_ptr 
  GetOrCreateTargetPhraseCollection
  ( RuleTrie &trie, const Phrase &source, const TargetPhrase &target, 
    const Word *sourceLHS) {
    return trie.GetOrCreateTargetPhraseCollection(source, target, sourceLHS);
  }
};

}  // namespace S2T
}  // namespace Syntax
}  // namespace Moses