mosesdecoder/lm
Hieu Hoang 98fc6d9917 xcode
2012-01-08 14:36:54 +07:00
..
bhiksha.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
bhiksha.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
binary_format.cc Attempt to fix a test failure for Hieu 2011-11-26 10:34:58 +00:00
binary_format.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
blank.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
build_binary.cc Nicer success message. Clean up some redundancy. 2011-11-30 11:13:42 +00:00
clean.sh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
compile.sh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
config.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
config.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
COPYING Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
COPYING.LESSER Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
enumerate_vocab.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
facade.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
Jamfile Avoid naming conflict with glibc's libutil 2011-11-28 09:19:45 +00:00
left_test.cc Updated kenlm 96ef3f2c11. 2011-11-17 19:12:19 +00:00
left.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
LICENSE Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
lm_exception.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
lm_exception.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
max_order.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
model_test.cc Updated kenlm 96ef3f2c11. 2011-11-17 19:12:19 +00:00
model_type.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
model.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
model.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
ngram_query.cc move some functions to .hh file for easier integration with other products 2011-12-20 16:44:45 +07:00
ngram_query.hh move some functions to .hh file for easier integration with other products 2011-12-20 16:44:45 +07:00
quantize.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
quantize.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
read_arpa.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
read_arpa.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
README Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
return.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
search_hashed.cc Updated kenlm 96ef3f2c11. 2011-11-17 19:12:19 +00:00
search_hashed.hh Updated kenlm 96ef3f2c11. 2011-11-17 19:12:19 +00:00
search_trie.cc Updated kenlm 96ef3f2c11. 2011-11-17 19:12:19 +00:00
search_trie.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
test_nounk.arpa Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
test.arpa Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
test.sh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
trie_sort.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
trie_sort.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
trie.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
trie.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
virtual_interface.cc Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
virtual_interface.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
vocab.cc Get more passive-aggressive about IRSTLM and <s>. 2011-12-01 13:32:15 +00:00
vocab.hh Updated kenlm 96ef3f2c11. 2011-11-17 19:12:19 +00:00
weights.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00
word_index.hh Move kenlm up one level, simplify compilation 2011-11-17 12:49:55 +00:00

Language model inference code by Kenneth Heafield <infer at kheafield.com>
The official website is http://kheafield.com/code/kenlm/ .  If you're a decoder developer, please download the latest version from there instead of copying from Moses.  

While the primary means of building kenlm for use in Moses is the Moses build system, you can also compile independently using:
./compile.sh to compile the code
./test.sh to compile and run tests; requires Boost
./clean.sh to clean

The rest of the documentation is directed at decoder developers.  

Binary format via mmap is supported.  Run ./build_binary to make one then pass the binary file name instead.  

Currently, it assumes POSIX APIs for errno, sterror_r, open, close, mmap, munmap, ftruncate, fstat, and read.  This is tested on Linux and the non-UNIX Mac OS X.  I welcome submissions porting (via #ifdef) to other systems (e.g. Windows) but proudly have no machine on which to test it.  

A brief note to Mac OS X users: your gcc is too old to recognize the pack pragma.  The warning effectively means that, on 64-bit machines, the model will use 16 bytes instead of 12 bytes per n-gram of maximum order (those of lower order are already 16 bytes) in the probing and sorted models.  The trie is not impacted by this.  

It does not depend on Boost or ICU.  However, if you use Boost and/or ICU in the rest of your code, you should define HAVE_BOOST and/or HAVE_ICU in util/have.hh.  Defining HAVE_BOOST will let you hash StringPiece.  Defining HAVE_ICU will use ICU's StringPiece to prevent a conflict with the one provided here.  

The recommend way to use this:
Copy the code and distribute with your decoder.  
Set HAVE_ICU and HAVE_BOOST at the top of util/have.hh as instructed above.  
Look at compile.sh and reimplement using your build system.  
Use either the interface in lm/model.hh or lm/virtual_interface.hh
Interface documentation is in comments of lm/virtual_interface.hh (including for lm/model.hh).  

I recommend copying the code and distributing it with your decoder.  However, please send improvements to me so that they can be integrated into the package.  

Also included:
A wrapper to SRI with the same interface.