File size: 779 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 |
#pragma once
#include "HyperTree.h"
namespace Moses
{
namespace Syntax
{
namespace F2S
{
// Base for classes that create a HyperTree (currently HyperTreeLoader and
// GlueRuleSynthesizer). HyperTreeCreator is a friend of HyperTree.
class HyperTreeCreator
{
protected:
// Provide access to HyperTree's private SortAndPrune function.
void SortAndPrune(HyperTree &trie, std::size_t limit) {
trie.SortAndPrune(limit);
}
// Provide access to HyperTree's private GetOrCreateTargetPhraseCollection
// function.
TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection(
HyperTree &trie, const HyperPath &fragment) {
return trie.GetOrCreateTargetPhraseCollection(fragment);
}
};
} // namespace F2S
} // namespace Syntax
} // namespace Moses
|