File size: 834 Bytes
5c711d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 "moses/Phrase.h"
#include "moses/TargetPhrase.h"

#include "HyperTree.h"
#include "HyperTreeCreator.h"
#include "Forest.h"

namespace Moses
{
class AllOptions;
namespace Syntax
{
namespace F2S
{

class GlueRuleSynthesizer : public HyperTreeCreator
{
  Word m_input_default_nonterminal;
  Word m_output_default_nonterminal;
public:
  GlueRuleSynthesizer(Moses::AllOptions const& opts, HyperTree &);

  // Synthesize the minimal, monotone rule that can be applied to the given
  // hyperedge and add it to the rule trie.
  void SynthesizeRule(const Forest::Hyperedge &);

private:
  void SynthesizeHyperPath(const Forest::Hyperedge &, HyperPath &);

  TargetPhrase *SynthesizeTargetPhrase(const Forest::Hyperedge &);

  HyperTree &m_hyperTree;
  Phrase m_dummySourcePhrase;
};

}  // F2S
}  // Syntax
}  // Moses