summaryrefslogtreecommitdiff
path: root/klm
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-08-03 07:46:54 -0400
committerKenneth Heafield <github@kheafield.com>2012-08-03 07:46:54 -0400
commit122f46c31102b683eaab3ad81a3a98accbc694bb (patch)
tree8d499d789b159ebed25bb23b6983813d064a6296 /klm
parentac664bdb0e481539cf77098a7dd0e1ec8d937ba0 (diff)
parent193d137056c3c4f73d66f8db84691d63307de894 (diff)
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'klm')
-rwxr-xr-x[-rw-r--r--]klm/compile.sh3
-rw-r--r--klm/lm/model.cc5
2 files changed, 3 insertions, 5 deletions
diff --git a/klm/compile.sh b/klm/compile.sh
index 56f2e9b2..55759f97 100644..100755
--- a/klm/compile.sh
+++ b/klm/compile.sh
@@ -7,7 +7,8 @@
set -e
-for i in util/{bit_packing,ersatz_progress,exception,file_piece,murmur_hash,file,mmap} lm/{bhiksha,binary_format,config,lm_exception,model,quantize,read_arpa,search_hashed,search_trie,trie,trie_sort,virtual_interface,vocab}; do
+rm {lm,util}/*.o
+for i in util/{bit_packing,ersatz_progress,exception,file_piece,murmur_hash,file,mmap,usage} lm/{bhiksha,binary_format,config,lm_exception,model,quantize,read_arpa,search_hashed,search_trie,trie,trie_sort,value_build,virtual_interface,vocab}; do
g++ -I. -O3 -DNDEBUG $CXXFLAGS -c $i.cc -o $i.o
done
g++ -I. -O3 -DNDEBUG $CXXFLAGS lm/build_binary.cc {lm,util}/*.o -lz -o build_binary
diff --git a/klm/lm/model.cc b/klm/lm/model.cc
index c081788c..a2d31ce0 100644
--- a/klm/lm/model.cc
+++ b/klm/lm/model.cc
@@ -53,9 +53,6 @@ template <class Search, class VocabularyT> void GenericModel<Search, VocabularyT
search_.LoadedBinary();
}
-namespace {
-} // namespace
-
template <class Search, class VocabularyT> void GenericModel<Search, VocabularyT>::InitializeFromARPA(const char *file, const Config &config) {
// Backing file is the ARPA. Steal it so we can make the backing file the mmap output if any.
util::FilePiece f(backing_.file.release(), file, config.messages);
@@ -126,7 +123,7 @@ template <class Search, class VocabularyT> FullScoreReturn GenericModel<Search,
return ret;
}
// i is the order of the backoff we're looking for.
- unsigned char order_minus_2 = 0;
+ unsigned char order_minus_2 = start - 2;
for (const WordIndex *i = context_rbegin + start - 1; i < context_rend; ++i, ++order_minus_2) {
typename Search::MiddlePointer p(search_.LookupMiddle(order_minus_2, *i, node, independent_left, extend_left));
if (!p.Found()) break;