00001 #pragma once 00002 00003 #include "moses/Phrase.h" 00004 #include "moses/TargetPhrase.h" 00005 00006 #include "HyperTree.h" 00007 #include "HyperTreeCreator.h" 00008 #include "Forest.h" 00009 00010 namespace Moses 00011 { 00012 class AllOptions; 00013 namespace Syntax 00014 { 00015 namespace F2S 00016 { 00017 00018 class GlueRuleSynthesizer : public HyperTreeCreator 00019 { 00020 Word m_input_default_nonterminal; 00021 Word m_output_default_nonterminal; 00022 public: 00023 GlueRuleSynthesizer(Moses::AllOptions const& opts, HyperTree &); 00024 00025 // Synthesize the minimal, monotone rule that can be applied to the given 00026 // hyperedge and add it to the rule trie. 00027 void SynthesizeRule(const Forest::Hyperedge &); 00028 00029 private: 00030 void SynthesizeHyperPath(const Forest::Hyperedge &, HyperPath &); 00031 00032 TargetPhrase *SynthesizeTargetPhrase(const Forest::Hyperedge &); 00033 00034 HyperTree &m_hyperTree; 00035 Phrase m_dummySourcePhrase; 00036 }; 00037 00038 } // F2S 00039 } // Syntax 00040 } // Moses