Skip to content

Latest commit

 

History

History
21 lines (19 loc) · 756 Bytes

File metadata and controls

21 lines (19 loc) · 756 Bytes

kenlm-cpp-example

Basic setup to use kenlm library in cpp

Setup kenlm

git clone https://github.com/kpu/kenlm.git
cd kenlm
mkdir -p build
cd build
cmake ..
make -j 4

If you get any compilations errors, then please check if you have all the dependencies installed link

Run example

Copy example.cpp to the parent directory of kenlm clone
You need to configure the path for your kenlm .binary or .arpa in example.cpp. Read the 'estimation' section of the readme here for instructions to create a kenlm binary.

g++ example.cpp -DKENLM_MAX_ORDER=6 -Ikenlm -Lkenlm/build/lib -lkenlm -lkenlm_util -lz -llzma -lbz2 -o example
./example