get rid of id's in dictionary

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@48 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
hieuhoang1972 2006-07-11 01:14:15 +00:00
parent 1e9af4107a
commit 7b1113eea7
7 changed files with 17 additions and 17 deletions

View File

@ -53,7 +53,7 @@ Hypothesis::Hypothesis(const Hypothesis &copy)
SetScore(copy.GetScore());
#ifdef N_BEST
m_lmScoreComponent = copy.GetLMScoreComponent();
m_ScoreComponent = copy.GetScoreComponent();
m_transScoreComponent = copy.GetScoreComponent();
m_generationScoreComponent = copy.GetGenerationScoreComponent();
#endif
@ -95,11 +95,11 @@ Hypothesis::Hypothesis(const Hypothesis &prevHypo, const TranslationOption &tran
// translation score
const ScoreComponentCollection &prevComponent= prevHypo.GetScoreComponent();
m_ScoreComponent = prevComponent;
m_transScoreComponent = prevComponent;
// add components specific to poss trans
const ScoreComponent &possComponent = transOpt.GetScoreComponents();
ScoreComponent &transComponent = m_ScoreComponent.GetScoreComponent(possComponent.GetPhraseDictionary());
ScoreComponent &transComponent = m_transScoreComponent.GetScoreComponent(possComponent.GetPhraseDictionary());
const size_t noScoreComponent = possComponent.GetNoScoreComponent();
for (size_t i = 0 ; i < noScoreComponent ; i++)
@ -152,7 +152,7 @@ Hypothesis *Hypothesis::MergeNext(const TranslationOption &transOpt) const
#ifdef N_BEST
const ScoreComponent &transOptComponent = transOpt.GetScoreComponents();
clone->m_ScoreComponent.Add(transOptComponent);
clone->m_transScoreComponent.Add(transOptComponent);
#endif
return clone;

View File

@ -53,7 +53,7 @@ void LatticeEdge::ResizeComponentScore(const LMList &allLM, const list < DecodeS
{
case Translate:
{
ScoreComponent &transScoreComponent = m_ScoreComponent.Add(&step.GetPhraseDictionary());
ScoreComponent &transScoreComponent = m_transScoreComponent.Add(&step.GetPhraseDictionary());
transScoreComponent.Reset();
break;
}

View File

@ -47,7 +47,7 @@ protected:
Phrase m_phrase;
#ifdef N_BEST
ScoreComponentCollection m_ScoreComponent;
ScoreComponentCollection m_transScoreComponent;
ScoreColl m_generationScoreComponent
,m_lmScoreComponent;
#endif
@ -63,7 +63,7 @@ public:
:m_prevHypo(prevHypo)
,m_phrase(phrase)
#ifdef N_BEST
,m_ScoreComponent(transScoreComponent)
,m_transScoreComponent(transScoreComponent)
,m_generationScoreComponent(generationScoreComponent)
,m_lmScoreComponent (lmScoreComponent)
#endif
@ -114,7 +114,7 @@ public:
inline const ScoreComponentCollection &GetScoreComponent() const
{
return m_ScoreComponent;
return m_transScoreComponent;
}
inline const ScoreColl &GetLMScoreComponent() const
{

View File

@ -35,7 +35,7 @@ LatticePath::LatticePath(const Hypothesis *hypo)
}
#ifdef N_BEST
m_lmScoreComponent = hypo->GetLMScoreComponent();
m_ScoreComponent = hypo->GetScoreComponent();
m_transScoreComponent = hypo->GetScoreComponent();
m_generationScoreComponent = hypo->GetGenerationScoreComponent();
#endif
@ -104,7 +104,7 @@ void LatticePath::CalcScore(const LatticePath &copy, size_t edgeIndex, const Arc
}
// phrase trans
m_ScoreComponent = copy.GetScoreComponent();
m_transScoreComponent = copy.GetScoreComponent();
const ScoreComponentCollection
&arcComponent = arc->GetScoreComponent()
@ -112,7 +112,7 @@ void LatticePath::CalcScore(const LatticePath &copy, size_t edgeIndex, const Arc
,&totalComponent= copy.GetScoreComponent();
ScoreComponentCollection::iterator iterTrans;
for (iterTrans = m_ScoreComponent.begin() ; iterTrans != m_ScoreComponent.end() ; ++iterTrans)
for (iterTrans = m_transScoreComponent.begin() ; iterTrans != m_transScoreComponent.end() ; ++iterTrans)
{
const PhraseDictionary *phraseDictionary = iterTrans->first;
ScoreComponent &transScore = *iterTrans->second;

View File

@ -42,7 +42,7 @@ protected:
size_t m_prevEdgeChanged;
float m_score[NUM_SCORES];
ScoreComponentCollection m_ScoreComponent;
ScoreComponentCollection m_transScoreComponent;
ScoreColl m_generationScoreComponent
, m_lmScoreComponent;
@ -88,7 +88,7 @@ public:
}
inline const ScoreComponentCollection &GetScoreComponent() const
{
return m_ScoreComponent;
return m_transScoreComponent;
}
inline const ScoreColl &GetGenerationScoreComponent() const
{

View File

@ -34,7 +34,7 @@ TranslationOption::TranslationOption(const WordsRange &wordsRange
,m_futureScore (0)
,m_ngramScore(0)
#ifdef N_BEST
,m_ScoreComponent(targetPhrase.GetScoreComponents())
,m_transScoreComponent(targetPhrase.GetScoreComponents())
#endif
{
}
@ -48,7 +48,7 @@ TranslationOption::TranslationOption(const WordsRange &wordsRange
,m_wordsRange (wordsRange)
,m_transScore (transScore)
#ifdef N_BEST
,m_ScoreComponent(targetPhrase.GetScoreComponents())
,m_transScoreComponent(targetPhrase.GetScoreComponents())
#endif
{
CalcFutureScore(lmList, weightWP);

View File

@ -37,7 +37,7 @@ protected:
WordsRange m_wordsRange;
float m_transScore, m_futureScore, m_ngramScore;
#ifdef N_BEST
ScoreComponent m_ScoreComponent;
ScoreComponent m_transScoreComponent;
std::list< std::pair<size_t, float> > m_lmScoreComponent;
std::list< std::pair<size_t, float> > m_trigramComponent;
#endif
@ -91,7 +91,7 @@ public:
#ifdef N_BEST
inline const ScoreComponent &GetScoreComponents() const
{
return m_ScoreComponent;
return m_transScoreComponent;
}
inline const std::list< std::pair<size_t, float> > &GetLMScoreComponent() const
{