summaryrefslogtreecommitdiff
path: root/klm/lm
diff options
context:
space:
mode:
authorKenneth Heafield <kenlm@kheafield.com>2011-09-25 19:18:36 -0400
committerKenneth Heafield <kenlm@kheafield.com>2011-09-25 19:18:36 -0400
commit5ef94f59e08d2f25bee8520c4233829207d1c034 (patch)
treebf8eeff33b08a8445e28a933792074dd199846ae /klm/lm
parent747309fcb0e0b1c6d060a68286ba1cf5ed1fbfa4 (diff)
Fix trie sort merging
Diffstat (limited to 'klm/lm')
-rw-r--r--klm/lm/trie_sort.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/klm/lm/trie_sort.cc b/klm/lm/trie_sort.cc
index 01c4e490..86f28493 100644
--- a/klm/lm/trie_sort.cc
+++ b/klm/lm/trie_sort.cc
@@ -146,7 +146,7 @@ template <class Combine> void MergeSortedFiles(const std::string &first_name, co
++first; ++second;
}
}
- for (RecordReader &remains = (first ? second : first); remains; ++remains) {
+ for (RecordReader &remains = (first ? first : second); remains; ++remains) {
WriteOrThrow(out_file.get(), remains.Data(), entry_size);
}
}
@@ -191,7 +191,7 @@ void ConvertToSorted(util::FilePiece &f, const SortedVocabulary &vocab, const st
assembled << file_prefix << static_cast<unsigned int>(order) << "_merge_" << (merge_count++);
files.push_back(assembled.str());
MergeSortedFiles(files[0], files[1], files.back(), weights_size, order, ThrowCombine());
- MergeSortedFiles(files[0], files[1], files.back(), 0, order, FirstCombine());
+ MergeSortedFiles(files[0] + kContextSuffix, files[1] + kContextSuffix, files.back() + kContextSuffix, 0, order, FirstCombine());
files.pop_front();
files.pop_front();
}