https://github.com/wilkeraziz/mosesdecoder
Tip revision: 1530ae4f5ff59cfd30f6f933e4dc05ea89cca8fc authored by Kenneth Heafield on 09 January 2013, 13:15:04 UTC
Fix state comparison (impacted 32-bit)
Fix state comparison (impacted 32-bit)
Tip revision: 1530ae4
TranslationOptionCollectionConfusionNet.cpp
// $Id$
#include "TranslationOptionCollectionConfusionNet.h"
#include "ConfusionNet.h"
#include "DecodeStep.h"
#include "moses/TranslationModel/PhraseDictionaryMemory.h"
#include "FactorCollection.h"
namespace Moses
{
/** constructor; just initialize the base class */
TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet(const TranslationSystem* system,
const ConfusionNet &input
, size_t maxNoTransOptPerCoverage, float translationOptionThreshold)
: TranslationOptionCollection(system, input, maxNoTransOptPerCoverage, translationOptionThreshold) {}
/* forcibly create translation option for a particular source word.
* call the base class' ProcessOneUnknownWord() for each possible word in the confusion network
* at a particular source position
*/
void TranslationOptionCollectionConfusionNet::ProcessUnknownWord(size_t sourcePos)
{
ConfusionNet const& source=dynamic_cast<ConfusionNet const&>(m_source);
ConfusionNet::Column const& coll=source.GetColumn(sourcePos);
size_t j=0;
for(ConfusionNet::Column::const_iterator i=coll.begin(); i!=coll.end(); ++i) {
ProcessOneUnknownWord(i->first ,sourcePos, source.GetColumnIncrement(sourcePos, j++),&(i->second));
}
}
}