#include <ExtractionPhrasePair.h>
Public Member Functions | |
| ExtractionPhrasePair (const PHRASE *phraseSource, const PHRASE *phraseTarget, ALIGNMENT *targetToSourceAlignment, float count, float pcfgSum) | |
| ~ExtractionPhrasePair () | |
| bool | Add (ALIGNMENT *targetToSourceAlignment, float count, float pcfgSum) |
| void | IncrementPrevious (float count, float pcfgSum) |
| bool | Matches (const PHRASE *otherPhraseSource, const PHRASE *otherPhraseTarget, ALIGNMENT *otherTargetToSourceAlignment) const |
| bool | Matches (const PHRASE *otherPhraseSource, const PHRASE *otherPhraseTarget, ALIGNMENT *otherTargetToSourceAlignment, bool &sourceMatch, bool &targetMatch, bool &alignmentMatch) const |
| bool | MatchesAlignment (ALIGNMENT *otherTargetToSourceAlignment) const |
| void | Clear () |
| bool | IsValid () const |
| const PHRASE * | GetSource () const |
| const PHRASE * | GetTarget () const |
| float | GetCount () const |
| float | GetPcfgScore () const |
| const size_t | GetNumberOfProperties () const |
| const std::map< std::string, float > * | GetProperty (const std::string &key) const |
| const ALIGNMENT * | FindBestAlignmentTargetToSource () const |
| const std::string * | FindBestPropertyValue (const std::string &key) const |
| std::string | CollectAllPropertyValues (const std::string &key) const |
| std::string | CollectAllLabelsSeparateLHSAndRHS (const std::string &propertyKey, std::set< std::string > &sourceLabelSet, boost::unordered_map< std::string, float > &sourceLHSCounts, boost::unordered_map< std::string, boost::unordered_map< std::string, float > * > &sourceRHSAndLHSJointCounts, Vocabulary &vcbT) const |
| void | CollectAllPhraseOrientations (const std::string &key, const std::vector< float > &orientationClassPriorsL2R, const std::vector< float > &orientationClassPriorsR2L, double smoothingFactor, std::ostream &out) const |
| void | UpdateVocabularyFromValueTokens (const std::string &propertyKey, std::set< std::string > &vocabulary) const |
| void | AddProperties (const std::string &str, float count) |
| void | AddProperty (const std::string &key, const std::string &value, float count) |
Protected Types | |
| typedef std::map< std::string, float > | PROPERTY_VALUES |
| typedef std::map< std::string, float >::iterator | LAST_PROPERTY_VALUE |
Protected Attributes | |
| bool | m_isValid |
| const PHRASE * | m_phraseSource |
| const PHRASE * | m_phraseTarget |
| float | m_count |
| float | m_pcfgSum |
| std::map< ALIGNMENT *, float > | m_targetToSourceAlignments |
| std::map< std::string, std::pair< PROPERTY_VALUES *, LAST_PROPERTY_VALUE * > > | m_properties |
| float | m_lastCount |
| float | m_lastPcfgSum |
| std::map< ALIGNMENT *, float > ::iterator | m_lastTargetToSourceAlignment |
Definition at line 35 of file ExtractionPhrasePair.h.
typedef std::map<std::string,float>::iterator MosesTraining::ExtractionPhrasePair::LAST_PROPERTY_VALUE [protected] |
Definition at line 41 of file ExtractionPhrasePair.h.
typedef std::map<std::string,float> MosesTraining::ExtractionPhrasePair::PROPERTY_VALUES [protected] |
Definition at line 40 of file ExtractionPhrasePair.h.
| MosesTraining::ExtractionPhrasePair::ExtractionPhrasePair | ( | const PHRASE * | phraseSource, | |
| const PHRASE * | phraseTarget, | |||
| ALIGNMENT * | targetToSourceAlignment, | |||
| float | count, | |||
| float | pcfgSum | |||
| ) |
Definition at line 41 of file ExtractionPhrasePair.cpp.
References m_count, m_isValid, m_lastCount, m_lastPcfgSum, m_lastTargetToSourceAlignment, m_pcfgSum, and m_targetToSourceAlignments.
| MosesTraining::ExtractionPhrasePair::~ExtractionPhrasePair | ( | ) |
Definition at line 66 of file ExtractionPhrasePair.cpp.
References Clear().

| bool MosesTraining::ExtractionPhrasePair::Add | ( | ALIGNMENT * | targetToSourceAlignment, | |
| float | count, | |||
| float | pcfgSum | |||
| ) |
Definition at line 74 of file ExtractionPhrasePair.cpp.
References m_count, m_lastCount, m_lastPcfgSum, m_lastTargetToSourceAlignment, m_pcfgSum, and m_targetToSourceAlignments.
Referenced by main().

| void MosesTraining::ExtractionPhrasePair::AddProperties | ( | const std::string & | str, | |
| float | count | |||
| ) |
Definition at line 226 of file ExtractionPhrasePair.cpp.
References AddProperty(), Moses::TokenizeFirstOnly(), and Moses::TokenizeMultiCharSeparator().
Referenced by main().


| void MosesTraining::ExtractionPhrasePair::AddProperty | ( | const std::string & | key, | |
| const std::string & | value, | |||
| float | count | |||
| ) | [inline] |
Definition at line 147 of file ExtractionPhrasePair.h.
References m_properties.
Referenced by AddProperties(), and MosesTraining::DomainFeature::addPropertiesToPhrasePair().

| void MosesTraining::ExtractionPhrasePair::Clear | ( | ) |
Definition at line 197 of file ExtractionPhrasePair.cpp.
References m_count, m_isValid, m_lastCount, m_lastPcfgSum, m_lastTargetToSourceAlignment, m_pcfgSum, m_phraseSource, m_phraseTarget, m_properties, and m_targetToSourceAlignments.
Referenced by ~ExtractionPhrasePair().

| std::string MosesTraining::ExtractionPhrasePair::CollectAllLabelsSeparateLHSAndRHS | ( | const std::string & | propertyKey, | |
| std::set< std::string > & | sourceLabelSet, | |||
| boost::unordered_map< std::string, float > & | sourceLHSCounts, | |||
| boost::unordered_map< std::string, boost::unordered_map< std::string, float > * > & | sourceRHSAndLHSJointCounts, | |||
| Vocabulary & | vcbT | |||
| ) | const |
Definition at line 329 of file ExtractionPhrasePair.cpp.
References EOF, GetProperty(), MosesTraining::Vocabulary::getWord(), m_phraseTarget, and NULL.
Referenced by outputPhrasePair().


| void MosesTraining::ExtractionPhrasePair::CollectAllPhraseOrientations | ( | const std::string & | key, | |
| const std::vector< float > & | orientationClassPriorsL2R, | |||
| const std::vector< float > & | orientationClassPriorsR2L, | |||
| double | smoothingFactor, | |||
| std::ostream & | out | |||
| ) | const |
Definition at line 471 of file ExtractionPhrasePair.cpp.
References EOF, GetProperty(), m_count, NULL, and UTIL_THROW.
Referenced by outputPhrasePair().


| std::string MosesTraining::ExtractionPhrasePair::CollectAllPropertyValues | ( | const std::string & | key | ) | const |
Definition at line 303 of file ExtractionPhrasePair.cpp.
References GetProperty(), and NULL.
Referenced by outputPhrasePair().


| const ALIGNMENT * MosesTraining::ExtractionPhrasePair::FindBestAlignmentTargetToSource | ( | ) | const |
Definition at line 250 of file ExtractionPhrasePair.cpp.
References m_targetToSourceAlignments, and NULL.
Referenced by outputPhrasePair().

| const std::string * MosesTraining::ExtractionPhrasePair::FindBestPropertyValue | ( | const std::string & | key | ) | const |
Definition at line 274 of file ExtractionPhrasePair.cpp.
References GetProperty(), and NULL.
Referenced by outputPhrasePair().


| float MosesTraining::ExtractionPhrasePair::GetCount | ( | ) | const [inline] |
Definition at line 102 of file ExtractionPhrasePair.h.
References m_count.
Referenced by MosesTraining::DomainFeature::add(), and outputPhrasePair().

| const size_t MosesTraining::ExtractionPhrasePair::GetNumberOfProperties | ( | ) | const [inline] |
| float MosesTraining::ExtractionPhrasePair::GetPcfgScore | ( | ) | const [inline] |
Definition at line 106 of file ExtractionPhrasePair.h.
References m_pcfgSum.
Referenced by outputPhrasePair().

| const std::map<std::string,float>* MosesTraining::ExtractionPhrasePair::GetProperty | ( | const std::string & | key | ) | const [inline] |
Definition at line 114 of file ExtractionPhrasePair.h.
References m_properties, and NULL.
Referenced by MosesTraining::InternalStructFeature::add(), MosesTraining::DomainFeature::add(), CollectAllLabelsSeparateLHSAndRHS(), CollectAllPhraseOrientations(), CollectAllPropertyValues(), FindBestPropertyValue(), and UpdateVocabularyFromValueTokens().

| const PHRASE* MosesTraining::ExtractionPhrasePair::GetSource | ( | ) | const [inline] |
Definition at line 94 of file ExtractionPhrasePair.h.
References m_phraseSource.
Referenced by outputPhrasePair().

| const PHRASE* MosesTraining::ExtractionPhrasePair::GetTarget | ( | ) | const [inline] |
Definition at line 98 of file ExtractionPhrasePair.h.
References m_phraseTarget.
Referenced by outputPhrasePair().

| void MosesTraining::ExtractionPhrasePair::IncrementPrevious | ( | float | count, | |
| float | pcfgSum | |||
| ) |
Definition at line 102 of file ExtractionPhrasePair.cpp.
References m_count, m_lastCount, m_lastPcfgSum, m_lastTargetToSourceAlignment, m_pcfgSum, and m_properties.
Referenced by main().

| bool MosesTraining::ExtractionPhrasePair::IsValid | ( | ) | const [inline] |
Definition at line 89 of file ExtractionPhrasePair.h.
References m_isValid.
Referenced by outputPhrasePair().

| bool MosesTraining::ExtractionPhrasePair::Matches | ( | const PHRASE * | otherPhraseSource, | |
| const PHRASE * | otherPhraseTarget, | |||
| ALIGNMENT * | otherTargetToSourceAlignment, | |||
| bool & | sourceMatch, | |||
| bool & | targetMatch, | |||
| bool & | alignmentMatch | |||
| ) | const |
Definition at line 140 of file ExtractionPhrasePair.cpp.
References m_phraseSource, m_phraseTarget, and MatchesAlignment().

| bool MosesTraining::ExtractionPhrasePair::Matches | ( | const PHRASE * | otherPhraseSource, | |
| const PHRASE * | otherPhraseTarget, | |||
| ALIGNMENT * | otherTargetToSourceAlignment | |||
| ) | const |
Definition at line 121 of file ExtractionPhrasePair.cpp.
References m_phraseSource, m_phraseTarget, and MatchesAlignment().
Referenced by main().


| bool MosesTraining::ExtractionPhrasePair::MatchesAlignment | ( | ALIGNMENT * | otherTargetToSourceAlignment | ) | const |
Definition at line 170 of file ExtractionPhrasePair.cpp.
References MosesTraining::Vocabulary::getWord(), MosesTraining::hierarchicalFlag, MosesTraining::isNonTerminal(), m_phraseTarget, m_targetToSourceAlignments, and MosesTraining::vcbT.
Referenced by Matches().


| void MosesTraining::ExtractionPhrasePair::UpdateVocabularyFromValueTokens | ( | const std::string & | propertyKey, | |
| std::set< std::string > & | vocabulary | |||
| ) | const |
Definition at line 561 of file ExtractionPhrasePair.cpp.
References GetProperty(), NULL, and MosesTraining::Tokenize().
Referenced by outputPhrasePair().


float MosesTraining::ExtractionPhrasePair::m_count [protected] |
Definition at line 49 of file ExtractionPhrasePair.h.
Referenced by Add(), Clear(), CollectAllPhraseOrientations(), ExtractionPhrasePair(), GetCount(), and IncrementPrevious().
bool MosesTraining::ExtractionPhrasePair::m_isValid [protected] |
Definition at line 44 of file ExtractionPhrasePair.h.
Referenced by Clear(), ExtractionPhrasePair(), and IsValid().
float MosesTraining::ExtractionPhrasePair::m_lastCount [protected] |
Definition at line 56 of file ExtractionPhrasePair.h.
Referenced by Add(), Clear(), ExtractionPhrasePair(), and IncrementPrevious().
float MosesTraining::ExtractionPhrasePair::m_lastPcfgSum [protected] |
Definition at line 57 of file ExtractionPhrasePair.h.
Referenced by Add(), Clear(), ExtractionPhrasePair(), and IncrementPrevious().
std::map<ALIGNMENT*,float>::iterator MosesTraining::ExtractionPhrasePair::m_lastTargetToSourceAlignment [protected] |
Definition at line 58 of file ExtractionPhrasePair.h.
Referenced by Add(), Clear(), ExtractionPhrasePair(), and IncrementPrevious().
float MosesTraining::ExtractionPhrasePair::m_pcfgSum [protected] |
Definition at line 50 of file ExtractionPhrasePair.h.
Referenced by Add(), Clear(), ExtractionPhrasePair(), GetPcfgScore(), and IncrementPrevious().
const PHRASE* MosesTraining::ExtractionPhrasePair::m_phraseSource [protected] |
Definition at line 46 of file ExtractionPhrasePair.h.
Referenced by Clear(), GetSource(), and Matches().
const PHRASE* MosesTraining::ExtractionPhrasePair::m_phraseTarget [protected] |
Definition at line 47 of file ExtractionPhrasePair.h.
Referenced by Clear(), CollectAllLabelsSeparateLHSAndRHS(), GetTarget(), Matches(), and MatchesAlignment().
std::map<std::string, std::pair< PROPERTY_VALUES*, LAST_PROPERTY_VALUE* > > MosesTraining::ExtractionPhrasePair::m_properties [protected] |
Definition at line 54 of file ExtractionPhrasePair.h.
Referenced by AddProperty(), Clear(), GetNumberOfProperties(), GetProperty(), and IncrementPrevious().
std::map<ALIGNMENT*,float> MosesTraining::ExtractionPhrasePair::m_targetToSourceAlignments [protected] |
Definition at line 52 of file ExtractionPhrasePair.h.
Referenced by Add(), Clear(), ExtractionPhrasePair(), FindBestAlignmentTargetToSource(), and MatchesAlignment().
1.5.9