Rule Class Reference

#include <Rule.h>

Collaboration diagram for Rule:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::set< std::pair
< int, int > > 
Alignments
typedef std::vector< PropertyProperties

Public Member Functions

 Rule (const Rule &copy)
 Rule (const NonTerm &lhsNonTerm, const AlignedSentence &alignedSentence)
 Rule (const Rule &copy, const NonTerm &nonTerm)
virtual ~Rule ()
bool IsValid () const
bool CanRecurse () const
const NonTermGetLHS () const
const ConsistentPhraseGetConsistentPhrase () const
int GetNextSourcePosForNonTerm () const
void SetCount (float count)
float GetCount () const
const AlignmentsGetAlignments () const
const PropertiesGetProperties () const
std::string Debug () const
void Output (std::ostream &out, bool forward) const
void Prevalidate (const Parameter &params)
void CreateTarget (const Parameter &params)
void CreateProperties (const Parameter &params)
const RulePhraseGetPhrase (Moses::FactorDirection direction) const

Protected Member Functions

void CreateSource ()
void CreateAlignments ()
void CreateAlignments (int sourcePos, const std::set< const Word * > &targetWords)
void CreateAlignments (int sourcePos, const RuleSymbol *targetSought)
bool ContainTerm (const ConsistentPhrase &cp, const std::set< const Word * > &terms) const
int GetScope (const Parameter &params) const
void NonTermContext (int sourceTarget, int factors, size_t ntInd, const ConsistentPhrase &cp, std::ostream &out) const
void NonTermContextFactor (int factor, const Word &word, std::ostream &out) const

Protected Attributes

const NonTermm_lhs
const AlignedSentencem_alignedSentence
RulePhrase m_source
RulePhrase m_target
float m_count
Alignments m_alignments
std::vector< const NonTerm * > m_nonterms
bool m_isValid
bool m_canRecurse
Properties m_properties


Detailed Description

Definition at line 20 of file Rule.h.


Member Typedef Documentation

typedef std::set<std::pair<int,int> > Rule::Alignments

Definition at line 23 of file Rule.h.

typedef std::vector<Property> Rule::Properties

Definition at line 24 of file Rule.h.


Constructor & Destructor Documentation

Rule::Rule ( const Rule copy  ) 

Rule::Rule ( const NonTerm lhsNonTerm,
const AlignedSentence alignedSentence 
)

Definition at line 18 of file Rule.cpp.

References CreateSource().

Here is the call graph for this function:

Rule::Rule ( const Rule copy,
const NonTerm nonTerm 
)

Definition at line 27 of file Rule.cpp.

References CreateSource(), and m_nonterms.

Here is the call graph for this function:

Rule::~Rule (  )  [virtual]

Definition at line 39 of file Rule.cpp.


Member Function Documentation

bool Rule::CanRecurse (  )  const [inline]

Definition at line 40 of file Rule.h.

References m_canRecurse.

Referenced by Rules::CreateRule(), and Rules::Extend().

Here is the caller graph for this function:

bool Rule::ContainTerm ( const ConsistentPhrase cp,
const std::set< const Word * > &  terms 
) const [protected]

Definition at line 509 of file Rule.cpp.

References Contains(), ConsistentPhrase::corners, AlignedSentence::GetPhrase(), Moses::Input, and m_alignedSentence.

Referenced by Prevalidate().

Here is the call graph for this function:

Here is the caller graph for this function:

void Rule::CreateAlignments ( int  sourcePos,
const RuleSymbol targetSought 
) [protected]

Definition at line 598 of file Rule.cpp.

References RulePhrase::GetSize(), m_alignments, and m_target.

Here is the call graph for this function:

void Rule::CreateAlignments ( int  sourcePos,
const std::set< const Word * > &  targetWords 
) [protected]

Definition at line 589 of file Rule.cpp.

References CreateAlignments().

Here is the call graph for this function:

void Rule::CreateAlignments (  )  [protected]

Definition at line 573 of file Rule.cpp.

References Word::GetAlignment(), RulePhrase::GetSize(), RuleSymbol::IsNonTerm(), and m_source.

Referenced by CreateAlignments(), and CreateTarget().

Here is the call graph for this function:

Here is the caller graph for this function:

void Rule::CreateProperties ( const Parameter params  ) 

void Rule::CreateSource (  )  [protected]

Definition at line 49 of file Rule.cpp.

References RulePhrase::Add(), ConsistentPhrase::corners, NonTerm::GetConsistentPhrase(), AlignedSentence::GetPhrase(), Moses::Input, m_alignedSentence, m_lhs, m_nonterms, m_source, and NULL.

Referenced by Rule().

Here is the call graph for this function:

Here is the caller graph for this function:

void Rule::CreateTarget ( const Parameter params  ) 

Definition at line 530 of file Rule.cpp.

References RulePhrase::Add(), CompareTargetNonTerms(), ConsistentPhrase::corners, CreateAlignments(), NonTerm::GetConsistentPhrase(), AlignedSentence::GetPhrase(), m_alignedSentence, m_isValid, m_lhs, m_nonterms, m_target, NULL, Moses::Output, and sort().

Referenced by Rules::CreateRule(), and Rules::Extend().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Rule::Debug (  )  const

Definition at line 95 of file Rule.cpp.

References NonTerm::Debug(), RuleSymbol::Debug(), RulePhrase::GetSize(), m_alignments, m_lhs, m_source, and m_target.

Referenced by Rules::Debug().

Here is the call graph for this function:

Here is the caller graph for this function:

const Alignments& Rule::GetAlignments (  )  const [inline]

Definition at line 59 of file Rule.h.

References m_alignments.

Referenced by CompareRules::operator()().

Here is the caller graph for this function:

const ConsistentPhrase & Rule::GetConsistentPhrase (  )  const

Definition at line 44 of file Rule.cpp.

References NonTerm::GetConsistentPhrase(), and m_lhs.

Referenced by Rules::CalcFractionalCount(), and Rules::Extend().

Here is the call graph for this function:

Here is the caller graph for this function:

float Rule::GetCount (  )  const [inline]

Definition at line 55 of file Rule.h.

References m_count.

Referenced by Rules::MergeRules().

Here is the caller graph for this function:

const NonTerm& Rule::GetLHS (  )  const [inline]

Definition at line 44 of file Rule.h.

References m_lhs.

Referenced by CompareRules::operator()().

Here is the caller graph for this function:

int Rule::GetNextSourcePosForNonTerm (  )  const

Definition at line 82 of file Rule.cpp.

References ConsistentPhrase::corners, NonTerm::GetConsistentPhrase(), m_lhs, and m_nonterms.

Referenced by Rules::Extend().

Here is the call graph for this function:

Here is the caller graph for this function:

const RulePhrase& Rule::GetPhrase ( Moses::FactorDirection  direction  )  const [inline]

Definition at line 74 of file Rule.h.

References Moses::Input, m_source, and m_target.

Referenced by CompareRules::operator()().

Here is the caller graph for this function:

const Properties& Rule::GetProperties (  )  const [inline]

Definition at line 63 of file Rule.h.

References m_properties.

Referenced by CompareRules::operator()().

Here is the caller graph for this function:

int Rule::GetScope ( const Parameter params  )  const [protected]

Definition at line 448 of file Rule.cpp.

References RulePhrase::GetSize(), Moses::Input, NonTerm::IsHiero(), RuleSymbol::IsNonTerm(), and m_source.

Referenced by Prevalidate().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Rule::IsValid (  )  const [inline]

Definition at line 36 of file Rule.h.

References m_isValid.

Referenced by Rules::CreateRule(), and Rules::Extend().

Here is the caller graph for this function:

void Rule::NonTermContext ( int  sourceTarget,
int  factors,
size_t  ntInd,
const ConsistentPhrase cp,
std::ostream &  out 
) const [protected]

Definition at line 184 of file Rule.cpp.

References ConsistentPhrase::corners, AlignedSentence::GetPhrase(), Moses::Input, m_alignedSentence, NonTermContextFactor(), and Moses::Output.

Referenced by CreateProperties().

Here is the call graph for this function:

Here is the caller graph for this function:

void Rule::NonTermContextFactor ( int  factor,
const Word word,
std::ostream &  out 
) const [protected]

Definition at line 179 of file Rule.cpp.

References Word::GetString().

Referenced by NonTermContext().

Here is the call graph for this function:

Here is the caller graph for this function:

void Rule::Output ( std::ostream &  out,
bool  forward 
) const

Definition at line 125 of file Rule.cpp.

References Moses::Input, m_alignments, m_count, m_lhs, m_properties, m_source, m_target, Moses::Output, NonTerm::Output(), and RulePhrase::Output().

Referenced by Rules::Output().

Here is the call graph for this function:

Here is the caller graph for this function:

void Rule::Prevalidate ( const Parameter params  ) 

void Rule::SetCount ( float  count  )  [inline]

Definition at line 52 of file Rule.h.

References m_count.

Referenced by Rules::CalcFractionalCount(), Rules::Consolidate(), and Rules::MergeRules().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 80 of file Rule.h.

Referenced by ContainTerm(), CreateSource(), CreateTarget(), and NonTermContext().

Definition at line 84 of file Rule.h.

Referenced by CreateAlignments(), Debug(), GetAlignments(), and Output().

bool Rule::m_canRecurse [protected]

Definition at line 89 of file Rule.h.

Referenced by CanRecurse(), and Prevalidate().

float Rule::m_count [protected]

Definition at line 82 of file Rule.h.

Referenced by GetCount(), Output(), and SetCount().

bool Rule::m_isValid [protected]

Definition at line 89 of file Rule.h.

Referenced by CreateTarget(), IsValid(), and Prevalidate().

const NonTerm& Rule::m_lhs [protected]

std::vector<const NonTerm*> Rule::m_nonterms [protected]

Definition at line 92 of file Rule.h.

Referenced by CreateProperties(), GetProperties(), and Output().

Definition at line 81 of file Rule.h.

Referenced by CreateAlignments(), CreateSource(), Debug(), GetPhrase(), GetScope(), Output(), and Prevalidate().

Definition at line 81 of file Rule.h.

Referenced by CreateAlignments(), CreateTarget(), Debug(), GetPhrase(), and Output().


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:31:59 2017 for Moses by  doxygen 1.5.9