diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-25 16:07:25 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-25 16:07:25 +0300 |
commit | 84b1c4b4c0c02362cdb35b55e08196d03b993baf (patch) | |
tree | 5b8526e6063ce08e0eb5c13bbef8d6e605f46748 /moses/FF | |
parent | eeff4fddc85c0edab1b2a3eb4ceecce243f52bc1 (diff) |
WordsBitmap -> Bitmap
Diffstat (limited to 'moses/FF')
-rw-r--r-- | moses/FF/BleuScoreFeature.cpp | 2 | ||||
-rw-r--r-- | moses/FF/FeatureFunction.h | 2 | ||||
-rw-r--r-- | moses/FF/LexicalReordering/LexicalReorderingState.cpp | 8 | ||||
-rw-r--r-- | moses/FF/LexicalReordering/LexicalReorderingState.h | 6 | ||||
-rw-r--r-- | moses/FF/OSM-Feature/OpSequenceModel.cpp | 6 | ||||
-rw-r--r-- | moses/FF/OSM-Feature/osmHyp.cpp | 4 | ||||
-rw-r--r-- | moses/FF/OSM-Feature/osmHyp.h | 4 |
7 files changed, 16 insertions, 16 deletions
diff --git a/moses/FF/BleuScoreFeature.cpp b/moses/FF/BleuScoreFeature.cpp index 5cd83732a..983dcac41 100644 --- a/moses/FF/BleuScoreFeature.cpp +++ b/moses/FF/BleuScoreFeature.cpp @@ -538,7 +538,7 @@ FFState* BleuScoreFeature::EvaluateWhenApplied(const Hypothesis& cur_hypo, ctx_start_idx = 0; } - WordsBitmap coverageVector = cur_hypo.GetWordsBitmap(); + Bitmap coverageVector = cur_hypo.GetWordsBitmap(); new_state->m_source_length = coverageVector.GetNumWordsCovered(); new_state->m_words = new_words.GetSubString(WordsRange(ctx_start_idx, diff --git a/moses/FF/FeatureFunction.h b/moses/FF/FeatureFunction.h index c95b5eb25..35febaaca 100644 --- a/moses/FF/FeatureFunction.h +++ b/moses/FF/FeatureFunction.h @@ -21,7 +21,7 @@ class Hypothesis; class ChartHypothesis; class InputType; class ScoreComponentCollection; -class WordsBitmap; +class Bitmap; class WordsRange; class FactorMask; class InputPath; diff --git a/moses/FF/LexicalReordering/LexicalReorderingState.cpp b/moses/FF/LexicalReordering/LexicalReorderingState.cpp index 1c30e49bb..8b6071f67 100644 --- a/moses/FF/LexicalReordering/LexicalReorderingState.cpp +++ b/moses/FF/LexicalReordering/LexicalReorderingState.cpp @@ -18,7 +18,7 @@ namespace Moses bool IsMonotonicStep(WordsRange const& prev, // words range of last source phrase WordsRange const& cur, // words range of current source phrase - WordsBitmap const& cov) // coverage bitmap + Bitmap const& cov) // coverage bitmap { size_t e = prev.GetEndPos() + 1; size_t s = cur.GetStartPos(); @@ -26,7 +26,7 @@ IsMonotonicStep(WordsRange const& prev, // words range of last source phrase } bool -IsSwap(WordsRange const& prev, WordsRange const& cur, WordsBitmap const& cov) +IsSwap(WordsRange const& prev, WordsRange const& cur, Bitmap const& cov) { size_t s = prev.GetStartPos(); size_t e = cur.GetEndPos(); @@ -111,7 +111,7 @@ GetOrientation(int const reoDistance) const LRModel::ReorderingType LRModel:: GetOrientation(WordsRange const& prev, WordsRange const& cur, - WordsBitmap const& cov) const + Bitmap const& cov) const { return ((m_modelType == LeftRight) ? cur.GetStartPos() > prev.GetEndPos() ? R : L @@ -494,7 +494,7 @@ Expand(TranslationOption const& topt, InputType const& input, { const WordsRange cur = topt.GetSourceWordsRange(); // keep track of the current coverage ourselves so we don't need the hypothesis - WordsBitmap cov = m_coverage; + Bitmap cov = m_coverage; cov.SetValue(cur, true); if (!m_first) { LRModel::ReorderingType reoType; diff --git a/moses/FF/LexicalReordering/LexicalReorderingState.h b/moses/FF/LexicalReordering/LexicalReorderingState.h index 51001e0e3..e135cafad 100644 --- a/moses/FF/LexicalReordering/LexicalReorderingState.h +++ b/moses/FF/LexicalReordering/LexicalReorderingState.h @@ -8,7 +8,7 @@ #include "moses/Hypothesis.h" #include "moses/ScoreComponentCollection.h" #include "moses/WordsRange.h" -#include "moses/WordsBitmap.h" +#include "moses/Bitmap.h" #include "moses/TranslationOption.h" #include "moses/FF/FFState.h" #include "ReorderingStack.h" @@ -66,7 +66,7 @@ public: ReorderingType // for HReorderingForwardState GetOrientation(WordsRange const& prev, WordsRange const& cur, - WordsBitmap const& cov) const; + Bitmap const& cov) const; ReorderingType // for HReorderingBackwarddState GetOrientation(int const reoDistance) const; @@ -289,7 +289,7 @@ class HReorderingForwardState : public LRState private: bool m_first; WordsRange m_prevRange; - WordsBitmap m_coverage; + Bitmap m_coverage; public: HReorderingForwardState(const LRModel &config, size_t sentenceLength, diff --git a/moses/FF/OSM-Feature/OpSequenceModel.cpp b/moses/FF/OSM-Feature/OpSequenceModel.cpp index d4e2f8719..d069e3e1f 100644 --- a/moses/FF/OSM-Feature/OpSequenceModel.cpp +++ b/moses/FF/OSM-Feature/OpSequenceModel.cpp @@ -50,7 +50,7 @@ void OpSequenceModel:: EvaluateInIsolation(const Phrase &source osmHypothesis obj; obj.setState(OSM->NullContextState()); - WordsBitmap myBitmap(source.GetSize()); + Bitmap myBitmap(source.GetSize()); vector <string> mySourcePhrase; vector <string> myTargetPhrase; vector<float> scores; @@ -93,8 +93,8 @@ FFState* OpSequenceModel::EvaluateWhenApplied( ScoreComponentCollection* accumulator) const { const TargetPhrase &target = cur_hypo.GetCurrTargetPhrase(); - const WordsBitmap &bitmap = cur_hypo.GetWordsBitmap(); - WordsBitmap myBitmap = bitmap; + const Bitmap &bitmap = cur_hypo.GetWordsBitmap(); + Bitmap myBitmap = bitmap; const Manager &manager = cur_hypo.GetManager(); const InputType &source = manager.GetSource(); // const Sentence &sourceSentence = static_cast<const Sentence&>(source); diff --git a/moses/FF/OSM-Feature/osmHyp.cpp b/moses/FF/OSM-Feature/osmHyp.cpp index 246d75e55..7689ccc34 100644 --- a/moses/FF/OSM-Feature/osmHyp.cpp +++ b/moses/FF/OSM-Feature/osmHyp.cpp @@ -169,7 +169,7 @@ string osmHypothesis :: intToString(int num) } -void osmHypothesis :: generateOperations(int & startIndex , int j1 , int contFlag , WordsBitmap & coverageVector , string english , string german , set <int> & targetNullWords , vector <string> & currF) +void osmHypothesis :: generateOperations(int & startIndex , int j1 , int contFlag , Bitmap & coverageVector , string english , string german , set <int> & targetNullWords , vector <string> & currF) { int gFlag = 0; @@ -362,7 +362,7 @@ void osmHypothesis :: generateDeleteOperations(std::string english, int currTarg } -void osmHypothesis :: computeOSMFeature(int startIndex , WordsBitmap & coverageVector) +void osmHypothesis :: computeOSMFeature(int startIndex , Bitmap & coverageVector) { set <int> doneTargetIndexes; diff --git a/moses/FF/OSM-Feature/osmHyp.h b/moses/FF/OSM-Feature/osmHyp.h index 9a92e0440..9093f542b 100644 --- a/moses/FF/OSM-Feature/osmHyp.h +++ b/moses/FF/OSM-Feature/osmHyp.h @@ -80,10 +80,10 @@ public: osmHypothesis(); ~osmHypothesis() {}; - void generateOperations(int & startIndex, int j1 , int contFlag , WordsBitmap & coverageVector , std::string english , std::string german , std::set <int> & targetNullWords , std::vector <std::string> & currF); + void generateOperations(int & startIndex, int j1 , int contFlag , Bitmap & coverageVector , std::string english , std::string german , std::set <int> & targetNullWords , std::vector <std::string> & currF); void generateDeleteOperations(std::string english, int currTargetIndex, std::set <int> doneTargetIndexes); void calculateOSMProb(OSMLM& ptrOp); - void computeOSMFeature(int startIndex , WordsBitmap & coverageVector); + void computeOSMFeature(int startIndex , Bitmap & coverageVector); void constructCepts(std::vector <int> & align , int startIndex , int endIndex, int targetPhraseLength); void setPhrases(std::vector <std::string> & val1 , std::vector <std::string> & val2) { currF = val1; |