Hi,

        Apparently target phrases keep track of their source phrases?  This is
incorrect with e.g. PhraseTableMemory (this is the code from revision 4364):

    Phrase sourcePhrase(Input, 0);
    sourcePhrase.CreateFromString( input, phraseVector);
    //target
    TargetPhrase targetPhrase(Output);
    targetPhrase.SetSourcePhrase(&sourcePhrase);

I'm currently refactoring it, but have provided the old version to make
it clear this isn't my fault.

The last line stores a pointer to a stack allocated object in
targetPhrase.  Furthermore, the sourcePhrase object does not even exist
in copy form, so there's nothing correct for it to point to.

I tried to remove it, apparently it makes its way to TranslationOption
and Hypothesis, GetSourcePhraseStringRep in particular.  That is called
only from Manager.cpp and used for logging purposes in e.g.:

outputWordGraphStream << "\tw=" << hypo->GetSourcePhraseStringRep() <<
"|" << hypo->GetCurrTargetPhrase();

On the basis that no logging is better than incorrect logging, I'm going
to stop tracking the source phrase in the target phrase.

Kenneth
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to