mark with LEGACY

This commit is contained in:
Hieu Hoang 2013-08-23 21:34:10 +01:00
parent 83df3629a9
commit f544d3aced
8 changed files with 21 additions and 21 deletions

View File

@ -137,7 +137,7 @@ void DecodeStepTranslation::ProcessInitialTranslation(
}
}
void DecodeStepTranslation::ProcessInitialTranslationLegacy(
void DecodeStepTranslation::ProcessInitialTranslationLEGACY(
const InputType &source
,PartialTranslOptColl &outputPartialTranslOptColl
, size_t startPos, size_t endPos, bool adhereTableLimit
@ -147,7 +147,7 @@ void DecodeStepTranslation::ProcessInitialTranslationLegacy(
const size_t tableLimit = phraseDictionary->GetTableLimit();
const WordsRange wordsRange(startPos, endPos);
const TargetPhraseCollectionWithSourcePhrase *phraseColl = phraseDictionary->GetTargetPhraseCollectionLegacy(source,wordsRange);
const TargetPhraseCollectionWithSourcePhrase *phraseColl = phraseDictionary->GetTargetPhraseCollectionLEGACY(source,wordsRange);
if (phraseColl != NULL) {
IFVERBOSE(3) {
@ -171,7 +171,7 @@ void DecodeStepTranslation::ProcessInitialTranslationLegacy(
const TargetPhrase &targetPhrase = **iterTargetPhrase;
const Phrase &sourcePhrase = *iterSourcePhrase;
const InputPath &inputPath = GetInputPathLegacy(targetPhrase, sourcePhrase, inputPathList);
const InputPath &inputPath = GetInputPathLEGACY(targetPhrase, sourcePhrase, inputPathList);
TranslationOption *transOpt = new TranslationOption(wordsRange, targetPhrase);
transOpt->SetInputPath(inputPath);
@ -184,7 +184,7 @@ void DecodeStepTranslation::ProcessInitialTranslationLegacy(
}
}
const InputPath &DecodeStepTranslation::GetInputPathLegacy(
const InputPath &DecodeStepTranslation::GetInputPathLEGACY(
const TargetPhrase targetPhrase,
const Phrase sourcePhrase,
const InputPathList &inputPathList) const
@ -207,7 +207,7 @@ const InputPath &DecodeStepTranslation::GetInputPathLegacy(
UTIL_THROW(util::Exception, "Input path not found");
}
void DecodeStepTranslation::ProcessLegacy(const TranslationOption &inputPartialTranslOpt
void DecodeStepTranslation::ProcessLEGACY(const TranslationOption &inputPartialTranslOpt
, const DecodeStep &decodeStep
, PartialTranslOptColl &outputPartialTranslOptColl
, TranslationOptionCollection *toc
@ -229,7 +229,7 @@ void DecodeStepTranslation::ProcessLegacy(const TranslationOption &inputPartialT
const size_t tableLimit = phraseDictionary->GetTableLimit();
const TargetPhraseCollectionWithSourcePhrase *phraseColl
= phraseDictionary->GetTargetPhraseCollectionLegacy(toc->GetSource(),sourceWordsRange);
= phraseDictionary->GetTargetPhraseCollectionLEGACY(toc->GetSource(),sourceWordsRange);
if (phraseColl != NULL) {

View File

@ -61,11 +61,11 @@ public:
, const TargetPhraseCollection *phraseColl) const;
// legacy
void ProcessInitialTranslationLegacy(const InputType &source
void ProcessInitialTranslationLEGACY(const InputType &source
, PartialTranslOptColl &outputPartialTranslOptColl
, size_t startPos, size_t endPos, bool adhereTableLimit
, const InputPathList &inputPathList) const;
void ProcessLegacy(const TranslationOption &inputPartialTranslOpt
void ProcessLEGACY(const TranslationOption &inputPartialTranslOpt
, const DecodeStep &decodeStep
, PartialTranslOptColl &outputPartialTranslOptColl
, TranslationOptionCollection *toc
@ -75,7 +75,7 @@ private:
// I'm not sure whether this actually works or not for binary phrase table.
// The source phrase only appears to contain the 1st word, therefore, this function
// only compares the 1st word
const InputPath &GetInputPathLegacy(const TargetPhrase targetPhrase,
const InputPath &GetInputPathLEGACY(const TargetPhrase targetPhrase,
const Phrase sourcePhrase,
const InputPathList &inputPathList) const;

View File

@ -82,7 +82,7 @@ const TargetPhraseCollection *PhraseDictionary::GetTargetPhraseCollectionNonCach
const TargetPhraseCollectionWithSourcePhrase* PhraseDictionary::
GetTargetPhraseCollectionLegacy(InputType const& src,WordsRange const& range) const
GetTargetPhraseCollectionLEGACY(InputType const& src,WordsRange const& range) const
{
UTIL_THROW(util::Exception, "Legacy method not implemented");
}

View File

@ -102,7 +102,7 @@ public:
// LEGACY
//! find list of translations that can translates a portion of src. Used by confusion network decoding
virtual const TargetPhraseCollectionWithSourcePhrase* GetTargetPhraseCollectionLegacy(InputType const& src,WordsRange const& range) const;
virtual const TargetPhraseCollectionWithSourcePhrase* GetTargetPhraseCollectionLEGACY(InputType const& src,WordsRange const& range) const;
protected:
size_t m_tableLimit;

View File

@ -108,7 +108,7 @@ const PDTAimp& PhraseDictionaryTreeAdaptor::GetImplementation() const
// legacy
const TargetPhraseCollectionWithSourcePhrase*
PhraseDictionaryTreeAdaptor::GetTargetPhraseCollectionLegacy(InputType const& src,WordsRange const &range) const
PhraseDictionaryTreeAdaptor::GetTargetPhraseCollectionLEGACY(InputType const& src,WordsRange const &range) const
{
if(GetImplementation().m_rangeCache.empty()) {
const TargetPhraseCollectionWithSourcePhrase *tpColl = GetImplementation().GetTargetPhraseCollection(src.GetSubString(range));

View File

@ -73,7 +73,7 @@ public:
}
// legacy
const TargetPhraseCollectionWithSourcePhrase *GetTargetPhraseCollectionLegacy(InputType const& src,WordsRange const & srcRange) const;
const TargetPhraseCollectionWithSourcePhrase *GetTargetPhraseCollectionLEGACY(InputType const& src,WordsRange const & srcRange) const;
};

View File

@ -104,7 +104,7 @@ TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet
// check whether we should be using the old code to supportbinary phrase-table.
// eventually, we'll stop support the binary phrase-table and delete this legacy code
CheckLegacy();
CheckLEGACY();
}
InputPathList &TranslationOptionCollectionConfusionNet::GetInputPathList(size_t startPos, size_t endPos)
@ -164,7 +164,7 @@ void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRange(
, size_t graphInd)
{
if (m_useLegacy) {
CreateTranslationOptionsForRangeLegacy(decodeGraph, startPos, endPos, adhereTableLimit, graphInd);
CreateTranslationOptionsForRangeLEGACY(decodeGraph, startPos, endPos, adhereTableLimit, graphInd);
} else {
CreateTranslationOptionsForRangeNew(decodeGraph, startPos, endPos, adhereTableLimit, graphInd);
}
@ -191,7 +191,7 @@ void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeNe
}
}
void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLegacy(
void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLEGACY(
const DecodeGraph &decodeGraph
, size_t startPos
, size_t endPos
@ -209,7 +209,7 @@ void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLe
list <const DecodeStep* >::const_iterator iterStep = decodeGraph.begin();
const DecodeStep &decodeStep = **iterStep;
static_cast<const DecodeStepTranslation&>(decodeStep).ProcessInitialTranslationLegacy
static_cast<const DecodeStepTranslation&>(decodeStep).ProcessInitialTranslationLEGACY
(m_source, *oldPtoc
, startPos, endPos, adhereTableLimit, inputPathList );
@ -231,7 +231,7 @@ void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLe
TranslationOption &inputPartialTranslOpt = **iterPartialTranslOpt;
if (transStep) {
transStep->ProcessLegacy(inputPartialTranslOpt
transStep->ProcessLEGACY(inputPartialTranslOpt
, *decodeStep
, *newPtoc
, this
@ -275,7 +275,7 @@ void TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLe
}
}
void TranslationOptionCollectionConfusionNet::CheckLegacy()
void TranslationOptionCollectionConfusionNet::CheckLEGACY()
{
const std::vector<PhraseDictionary*> &pts = StaticData::Instance().GetPhraseDictionaries();
for (size_t i = 0; i < pts.size(); ++i) {

View File

@ -30,8 +30,8 @@ protected:
, bool adhereTableLimit
, size_t graphInd);
void CheckLegacy();
void CreateTranslationOptionsForRangeLegacy(const DecodeGraph &decodeStepList
void CheckLEGACY();
void CreateTranslationOptionsForRangeLEGACY(const DecodeGraph &decodeStepList
, size_t startPosition
, size_t endPosition
, bool adhereTableLimit