diff options
author | heafield <heafield@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-10-11 14:12:17 +0400 |
---|---|---|
committer | heafield <heafield@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-10-11 14:12:17 +0400 |
commit | c9995dc44c1a4f1cd38253415cd8cbe8dbab9fb6 (patch) | |
tree | bf303e81ff58db4235f80967344d870a6429e303 /kenlm | |
parent | b0e5d6c005ab007bb1975098c68f9031ca174f57 (diff) |
Trie building bug fix
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4323 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'kenlm')
-rw-r--r-- | kenlm/lm/search_trie.cc | 2 | ||||
-rw-r--r-- | kenlm/lm/trie_sort.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kenlm/lm/search_trie.cc b/kenlm/lm/search_trie.cc index 6479813b8..b53aa8437 100644 --- a/kenlm/lm/search_trie.cc +++ b/kenlm/lm/search_trie.cc @@ -525,7 +525,7 @@ template <class Quant, class Bhiksha> void BuildTrie(const std::string &file_pre const RecordReader &context = contexts[order - 2]; if (context) { FormatLoadException e; - e << "An " << static_cast<unsigned int>(order) << "-gram has context"; + e << "A " << static_cast<unsigned int>(order) << "-gram has context"; const WordIndex *ctx = reinterpret_cast<const WordIndex*>(context.Data()); for (const WordIndex *i = ctx; i != ctx + order - 1; ++i) { e << ' ' << *i; diff --git a/kenlm/lm/trie_sort.cc b/kenlm/lm/trie_sort.cc index 86f284932..bb126f18c 100644 --- a/kenlm/lm/trie_sort.cc +++ b/kenlm/lm/trie_sort.cc @@ -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] + kContextSuffix, files[1] + kContextSuffix, files.back() + kContextSuffix, 0, order, FirstCombine()); + MergeSortedFiles(files[0] + kContextSuffix, files[1] + kContextSuffix, files.back() + kContextSuffix, 0, order - 1, FirstCombine()); files.pop_front(); files.pop_front(); } |