diff --git a/contrib/other-builds/moses2/FF/LexicalReordering/LexicalReordering.cpp b/contrib/other-builds/moses2/FF/LexicalReordering/LexicalReordering.cpp index 7c722f9c2..d3cdbd3c9 100644 --- a/contrib/other-builds/moses2/FF/LexicalReordering/LexicalReordering.cpp +++ b/contrib/other-builds/moses2/FF/LexicalReordering/LexicalReordering.cpp @@ -7,7 +7,7 @@ #include #include "LexicalReordering.h" -#include "PhraseLR.h" +#include "PhraseBasedReorderingState.h" #include "../../TranslationModel/PhraseTable.h" #include "../../System.h" #include "../../PhraseImpl.h" @@ -113,7 +113,7 @@ void LexicalReordering::SetParameter(const std::string& key, const std::string& FFState* LexicalReordering::BlankState(MemPool &pool) const { - return new (pool.Allocate()) LexicalReorderingState(); + return new (pool.Allocate()) PhraseBasedReorderingState(); } void LexicalReordering::EmptyHypothesisState(FFState &state, @@ -121,7 +121,7 @@ void LexicalReordering::EmptyHypothesisState(FFState &state, const InputType &input, const Hypothesis &hypo) const { - LexicalReorderingState &stateCast = static_cast(state); + PhraseBasedReorderingState &stateCast = static_cast(state); stateCast.path = &hypo.GetInputPath(); stateCast.targetPhrase = &hypo.GetTargetPhrase(); } @@ -192,7 +192,7 @@ void LexicalReordering::EvaluateWhenApplied(const ManagerBase &mgr, FFState &state) const { if (m_phraseBased) { - const LexicalReorderingState &prevStateCast = static_cast(prevState); + const PhraseBasedReorderingState &prevStateCast = static_cast(prevState); prevStateCast.Expand(mgr.system, *this, hypo, m_PhraseTableInd, scores, state); } else { @@ -207,8 +207,8 @@ void LexicalReordering::EvaluateWhenAppliedPB(const ManagerBase &mgr, Scores &scores, FFState &state) const { - const LexicalReorderingState &prevStateCast = static_cast(prevState); - LexicalReorderingState &stateCast = static_cast(state); + const PhraseBasedReorderingState &prevStateCast = static_cast(prevState); + PhraseBasedReorderingState &stateCast = static_cast(state); const Range &currRange = hypo.GetInputPath().range; stateCast.path = &hypo.GetInputPath(); diff --git a/contrib/other-builds/moses2/FF/LexicalReordering/PhraseLR.cpp b/contrib/other-builds/moses2/FF/LexicalReordering/PhraseBasedReorderingState.cpp similarity index 77% rename from contrib/other-builds/moses2/FF/LexicalReordering/PhraseLR.cpp rename to contrib/other-builds/moses2/FF/LexicalReordering/PhraseBasedReorderingState.cpp index f901a1398..ee886a182 100644 --- a/contrib/other-builds/moses2/FF/LexicalReordering/PhraseLR.cpp +++ b/contrib/other-builds/moses2/FF/LexicalReordering/PhraseBasedReorderingState.cpp @@ -5,21 +5,21 @@ * Author: hieu */ -#include "PhraseLR.h" +#include "PhraseBasedReorderingState.h" #include "LexicalReordering.h" #include "../../PhraseBased/Hypothesis.h" namespace Moses2 { -void LexicalReorderingState::Expand(const System &system, +void PhraseBasedReorderingState::Expand(const System &system, const LexicalReordering &ff, const Hypothesis &hypo, size_t phraseTableInd, Scores &scores, FFState &state) const { - const LexicalReorderingState &prevStateCast = static_cast(*this); - LexicalReorderingState &stateCast = static_cast(state); + const PhraseBasedReorderingState &prevStateCast = static_cast(*this); + PhraseBasedReorderingState &stateCast = static_cast(state); const Range &currRange = hypo.GetInputPath().range; stateCast.path = &hypo.GetInputPath(); @@ -55,12 +55,12 @@ void LexicalReorderingState::Expand(const System &system, } } -size_t LexicalReorderingState::GetOrientation(Range const& cur) const +size_t PhraseBasedReorderingState::GetOrientation(Range const& cur) const { return (cur.GetStartPos() == 0) ? 0 : 2; } -size_t LexicalReorderingState::GetOrientation(Range const& prev, Range const& cur) const +size_t PhraseBasedReorderingState::GetOrientation(Range const& prev, Range const& cur) const { if (cur.GetStartPos() == prev.GetEndPos() + 1) { // monotone diff --git a/contrib/other-builds/moses2/FF/LexicalReordering/PhraseLR.h b/contrib/other-builds/moses2/FF/LexicalReordering/PhraseBasedReorderingState.h similarity index 84% rename from contrib/other-builds/moses2/FF/LexicalReordering/PhraseLR.h rename to contrib/other-builds/moses2/FF/LexicalReordering/PhraseBasedReorderingState.h index b5c0022e1..fbab6282f 100644 --- a/contrib/other-builds/moses2/FF/LexicalReordering/PhraseLR.h +++ b/contrib/other-builds/moses2/FF/LexicalReordering/PhraseBasedReorderingState.h @@ -15,13 +15,13 @@ class TargetPhrase; class LexicalReordering; class Hypothesis; -class LexicalReorderingState : public FFState +class PhraseBasedReorderingState : public FFState { public: const InputPathBase *path; const TargetPhrase *targetPhrase; - LexicalReorderingState() + PhraseBasedReorderingState() { // uninitialised } @@ -32,7 +32,7 @@ public: } virtual bool operator==(const FFState& other) const { // compare range address. All ranges are created in InputPathBase - const LexicalReorderingState &stateCast = static_cast(other); + const PhraseBasedReorderingState &stateCast = static_cast(other); return &path->range == &stateCast.path->range; } diff --git a/contrib/other-builds/moses2/Jamfile b/contrib/other-builds/moses2/Jamfile index 66382859c..d792d792a 100644 --- a/contrib/other-builds/moses2/Jamfile +++ b/contrib/other-builds/moses2/Jamfile @@ -32,7 +32,7 @@ alias deps : ../../..//z ../../..//boost_iostreams ../../..//boost_filesystem . FF/WordPenalty.cpp FF/LexicalReordering/LexicalReordering.cpp - FF/LexicalReordering/PhraseLR.cpp + FF/LexicalReordering/PhraseBasedReorderingState.cpp # LM/LanguageModelDALM.cpp LM/LanguageModel.cpp