mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Binary phrase table does string ops, at least make them fast
This commit is contained in:
parent
44a0e52e30
commit
73035543d6
@ -11,6 +11,7 @@
|
||||
#include "moses/TranslationModel/PhraseDictionaryTreeAdaptor.h"
|
||||
#include "SparsePhraseDictionaryFeature.h"
|
||||
#include "Util.h"
|
||||
#include "util/tokenize_piece.hh"
|
||||
|
||||
namespace Moses
|
||||
{
|
||||
@ -284,11 +285,10 @@ protected:
|
||||
FactorCollection &factorCollection = FactorCollection::Instance();
|
||||
|
||||
for(size_t k=0; k<factorStrings.size(); ++k) {
|
||||
std::vector<std::string> factors=TokenizeMultiCharSeparator(*factorStrings[k],StaticData::Instance().GetFactorDelimiter());
|
||||
CHECK(factors.size()==m_output.size());
|
||||
util::TokenIter<util::MultiCharacter, false> word(*factorStrings[k], StaticData::Instance().GetFactorDelimiter());
|
||||
Word& w=targetPhrase.AddWord();
|
||||
for(size_t l=0; l<m_output.size(); ++l) {
|
||||
w[m_output[l]]= factorCollection.AddFactor(Output, m_output[l], factors[l]);
|
||||
for(size_t l=0; l<m_output.size(); ++l, ++word) {
|
||||
w[m_output[l]]= factorCollection.AddFactor(*word);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user