mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Add const.
This commit is contained in:
parent
9bfb965c2f
commit
4650e30380
@ -365,7 +365,7 @@ void TranslationOptionCollection::CreateTranslationOptions()
|
||||
const vector <size_t> &decodeGraphBackoff = m_system->GetDecodeGraphBackoff();
|
||||
|
||||
// length of the sentence
|
||||
size_t size = m_source.GetSize();
|
||||
const size_t size = m_source.GetSize();
|
||||
|
||||
// loop over all decoding graphs, each generates translation options
|
||||
for (size_t graphInd = 0 ; graphInd < decodeGraphList.size() ; graphInd++) {
|
||||
@ -376,9 +376,8 @@ void TranslationOptionCollection::CreateTranslationOptions()
|
||||
const DecodeGraph &decodeGraph = *decodeGraphList[graphInd];
|
||||
// generate phrases that start at startPos ...
|
||||
for (size_t startPos = 0 ; startPos < size; startPos++) {
|
||||
size_t maxSize = size - startPos; // don't go over end of sentence
|
||||
size_t maxSizePhrase = StaticData::Instance().GetMaxPhraseLength();
|
||||
maxSize = std::min(maxSize, maxSizePhrase);
|
||||
const size_t maxSizePhrase = StaticData::Instance().GetMaxPhraseLength();
|
||||
const size_t maxSize = std::min(size - startPos, maxSizePhrase); // don't go over end of sentence
|
||||
|
||||
// ... and that end at endPos
|
||||
for (size_t endPos = startPos ; endPos < startPos + maxSize ; endPos++) {
|
||||
|
Loading…
Reference in New Issue
Block a user