00001 #pragma once 00002 00003 #include "HyperTree.h" 00004 00005 namespace Moses 00006 { 00007 namespace Syntax 00008 { 00009 namespace F2S 00010 { 00011 00012 // Base for classes that create a HyperTree (currently HyperTreeLoader and 00013 // GlueRuleSynthesizer). HyperTreeCreator is a friend of HyperTree. 00014 class HyperTreeCreator 00015 { 00016 protected: 00017 // Provide access to HyperTree's private SortAndPrune function. 00018 void SortAndPrune(HyperTree &trie, std::size_t limit) { 00019 trie.SortAndPrune(limit); 00020 } 00021 00022 // Provide access to HyperTree's private GetOrCreateTargetPhraseCollection 00023 // function. 00024 TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection( 00025 HyperTree &trie, const HyperPath &fragment) { 00026 return trie.GetOrCreateTargetPhraseCollection(fragment); 00027 } 00028 }; 00029 00030 } // namespace F2S 00031 } // namespace Syntax 00032 } // namespace Moses