mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Unbodge kenlm by moving compilation to kenlm/ instead of kenlm/lm. Changing the headers every
time I copied to Moses was getting annoying. git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3587 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
d99066e4e9
commit
770df2a92d
@ -11,4 +11,4 @@ endif
|
||||
if WITH_SERVER
|
||||
SERVER = server
|
||||
endif
|
||||
SUBDIRS = moses/src moses-chart/src OnDiskPt/src kenlm/lm moses-cmd/src misc moses-chart-cmd/src CreateOnDisk/src $(MERT) $(SERVER)
|
||||
SUBDIRS = moses/src moses-chart/src OnDiskPt/src kenlm moses-cmd/src misc moses-chart-cmd/src CreateOnDisk/src $(MERT) $(SERVER)
|
||||
|
@ -174,14 +174,14 @@ fi
|
||||
if test "x$with_kenlm" != 'xno'
|
||||
then
|
||||
SAVE_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -I${with_kenlm}/lm"
|
||||
CPPFLAGS="$CPPFLAGS -I${with_kenlm}"
|
||||
|
||||
AC_CHECK_HEADER(ngram.hh,
|
||||
AC_CHECK_HEADER(lm/ngram.hh,
|
||||
[AC_DEFINE([HAVE_KENLM], [], [flag for KENLM])],
|
||||
[AC_MSG_ERROR([Cannot find KEN-LM in ${with_kenlm}])])
|
||||
|
||||
LIB_KENLM="-lkenlm"
|
||||
LDFLAGS="$LDFLAGS -L${with_kenlm}/lm"
|
||||
LDFLAGS="$LDFLAGS -L${with_kenlm}"
|
||||
LIBS="$LIBS $LIB_KENLM"
|
||||
FMTLIBS="$FMTLIBS libkenlm.a"
|
||||
AM_CONDITIONAL([KEN_LM], true)
|
||||
@ -228,6 +228,6 @@ fi
|
||||
LIBS="$LIBS -lz"
|
||||
|
||||
|
||||
AC_CONFIG_FILES(Makefile OnDiskPt/src/Makefile moses/src/Makefile moses-chart/src/Makefile moses-cmd/src/Makefile moses-chart-cmd/src/Makefile misc/Makefile mert/Makefile server/Makefile CreateOnDisk/src/Makefile kenlm/lm/Makefile)
|
||||
AC_CONFIG_FILES(Makefile OnDiskPt/src/Makefile moses/src/Makefile moses-chart/src/Makefile moses-cmd/src/Makefile moses-chart-cmd/src/Makefile misc/Makefile mert/Makefile server/Makefile CreateOnDisk/src/Makefile kenlm/Makefile)
|
||||
|
||||
AC_OUTPUT()
|
||||
|
27
kenlm/Makefile.am
Normal file
27
kenlm/Makefile.am
Normal file
@ -0,0 +1,27 @@
|
||||
lib_LIBRARIES = libkenlm.a
|
||||
bin_PROGRAMS = query build_binary
|
||||
|
||||
AM_CPPFLAGS = -W -Wall -ffor-scope -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES $(BOOST_CPPFLAGS)
|
||||
libkenlm_a_SOURCES = \
|
||||
lm/lm_exception.cc \
|
||||
lm/ngram.cc \
|
||||
lm/read_arpa.cc \
|
||||
lm/virtual_interface.cc \
|
||||
lm/vocab.cc \
|
||||
util/string_piece.cc \
|
||||
util/scoped.cc \
|
||||
util/murmur_hash.cc \
|
||||
util/mmap.cc \
|
||||
util/file_piece.cc \
|
||||
util/ersatz_progress.cc \
|
||||
util/exception.cc \
|
||||
util/string_piece.cc
|
||||
|
||||
query_SOURCES = lm/ngram_query.cc
|
||||
query_DEPENDENCIES = libkenlm.a
|
||||
query_LDADD = -L$(top_srcdir)/kenlm -lkenlm
|
||||
|
||||
build_binary_SOURCES = lm/ngram_build_binary.cc
|
||||
build_binary_DEPENDENCIES = libkenlm.a
|
||||
build_binary_LDADD = -L$(top_srcdir)/kenlm -lkenlm
|
||||
|
@ -1,27 +0,0 @@
|
||||
lib_LIBRARIES = libkenlm.a
|
||||
bin_PROGRAMS = query build_binary
|
||||
|
||||
AM_CPPFLAGS = -W -Wall -ffor-scope -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES $(BOOST_CPPFLAGS)
|
||||
libkenlm_a_SOURCES = \
|
||||
virtual_interface.cc \
|
||||
ngram.cc \
|
||||
exception.cc \
|
||||
read_arpa.cc \
|
||||
vocab.cc \
|
||||
../util/string_piece.cc \
|
||||
../util/scoped.cc \
|
||||
../util/murmur_hash.cc \
|
||||
../util/mmap.cc \
|
||||
../util/file_piece.cc \
|
||||
../util/ersatz_progress.cc \
|
||||
../util/exception_util.cc \
|
||||
../util/string_piece.cc
|
||||
|
||||
query_SOURCES = ngram_query.cc
|
||||
query_DEPENDENCIES = libkenlm.a
|
||||
query_LDADD = -L$(top_srcdir)/kenlm/lm -lkenlm
|
||||
|
||||
build_binary_SOURCES = ngram_build_binary.cc
|
||||
build_binary_DEPENDENCIES = libkenlm.a
|
||||
build_binary_LDADD = -L$(top_srcdir)/kenlm/lm -lkenlm
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef LM_FACADE__
|
||||
#define LM_FACADE__
|
||||
|
||||
#include "virtual_interface.hh"
|
||||
#include "../util/string_piece.hh"
|
||||
#include "lm/virtual_interface.hh"
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "exception.hh"
|
||||
#include "lm/lm_exception.hh"
|
||||
|
||||
#include<errno.h>
|
||||
#include<stdio.h>
|
@ -1,8 +1,8 @@
|
||||
#ifndef LM_EXCEPTION__
|
||||
#define LM_EXCEPTION__
|
||||
|
||||
#include "../util/exception_util.hh"
|
||||
#include "../util/string_piece.hh"
|
||||
#include "util/exception.hh"
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
@ -1,11 +1,11 @@
|
||||
#include "ngram.hh"
|
||||
|
||||
#include "exception.hh"
|
||||
#include "read_arpa.hh"
|
||||
#include "../util/file_piece.hh"
|
||||
#include "../util/joint_sort.hh"
|
||||
#include "../util/murmur_hash.hh"
|
||||
#include "../util/probing_hash_table.hh"
|
||||
#include "lm/lm_exception.hh"
|
||||
#include "lm/read_arpa.hh"
|
||||
#include "util/file_piece.hh"
|
||||
#include "util/joint_sort.hh"
|
||||
#include "util/murmur_hash.hh"
|
||||
#include "util/probing_hash_table.hh"
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
@ -1,16 +1,16 @@
|
||||
#ifndef LM_NGRAM__
|
||||
#define LM_NGRAM__
|
||||
|
||||
#include "facade.hh"
|
||||
#include "ngram_config.hh"
|
||||
#include "vocab.hh"
|
||||
#include "weights.hh"
|
||||
#include "../util/key_value_packing.hh"
|
||||
#include "../util/mmap.hh"
|
||||
#include "../util/probing_hash_table.hh"
|
||||
#include "../util/scoped.hh"
|
||||
#include "../util/sorted_uniform.hh"
|
||||
#include "../util/string_piece.hh"
|
||||
#include "lm/facade.hh"
|
||||
#include "lm/ngram_config.hh"
|
||||
#include "lm/vocab.hh"
|
||||
#include "lm/weights.hh"
|
||||
#include "util/key_value_packing.hh"
|
||||
#include "util/mmap.hh"
|
||||
#include "util/probing_hash_table.hh"
|
||||
#include "util/scoped.hh"
|
||||
#include "util/sorted_uniform.hh"
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "ngram.hh"
|
||||
#include "lm/ngram.hh"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "ngram.hh"
|
||||
#include "lm/ngram.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "read_arpa.hh"
|
||||
#include "lm/read_arpa.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <ctype.h>
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef LM_READ_ARPA__
|
||||
#define LM_READ_ARPA__
|
||||
|
||||
#include "exception.hh"
|
||||
#include "weights.hh"
|
||||
#include "word_index.hh"
|
||||
#include "../util/file_piece.hh"
|
||||
#include "lm/lm_exception.hh"
|
||||
#include "lm/weights.hh"
|
||||
#include "lm/word_index.hh"
|
||||
#include "util/file_piece.hh"
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "exception.hh"
|
||||
#include "sri.hh"
|
||||
#include "lm/lm_exception.hh"
|
||||
#include "lm/sri.hh"
|
||||
|
||||
#include <Ngram.h>
|
||||
#include <Vocab.h>
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef LM_SRI__
|
||||
#define LM_SRI__
|
||||
|
||||
#include "facade.hh"
|
||||
#include "../util/murmur_hash.hh"
|
||||
#include "lm/facade.hh"
|
||||
#include "util/murmur_hash.hh"
|
||||
|
||||
#include <cmath>
|
||||
#include <exception>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "sri.hh"
|
||||
#include "lm/sri.hh"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "virtual_interface.hh"
|
||||
#include "exception.hh"
|
||||
#include "lm/virtual_interface.hh"
|
||||
#include "lm/lm_exception.hh"
|
||||
|
||||
namespace lm {
|
||||
namespace base {
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef LM_VIRTUAL_INTERFACE__
|
||||
#define LM_VIRTUAL_INTERFACE__
|
||||
|
||||
#include "word_index.hh"
|
||||
#include "../util/string_piece.hh"
|
||||
#include "lm/word_index.hh"
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "vocab.hh"
|
||||
#include "lm/vocab.hh"
|
||||
|
||||
#include "weights.hh"
|
||||
#include "../util/joint_sort.hh"
|
||||
#include "../util/murmur_hash.hh"
|
||||
#include "../util/probing_hash_table.hh"
|
||||
#include "lm/weights.hh"
|
||||
#include "util/joint_sort.hh"
|
||||
#include "util/murmur_hash.hh"
|
||||
#include "util/probing_hash_table.hh"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef LM_VOCAB__
|
||||
#define LM_VOCAB__
|
||||
|
||||
#include "virtual_interface.hh"
|
||||
#include "../util/key_value_packing.hh"
|
||||
#include "../util/probing_hash_table.hh"
|
||||
#include "../util/sorted_uniform.hh"
|
||||
#include "../util/string_piece.hh"
|
||||
#include "lm/virtual_interface.hh"
|
||||
#include "util/key_value_packing.hh"
|
||||
#include "util/probing_hash_table.hh"
|
||||
#include "util/sorted_uniform.hh"
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
namespace lm {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "ersatz_progress.hh"
|
||||
#include "util/ersatz_progress.hh"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ostream>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "exception_util.hh"
|
||||
#include "util/exception.hh"
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
@ -1,7 +1,7 @@
|
||||
#ifndef UTIL_EXCEPTION__
|
||||
#define UTIL_EXCEPTION__
|
||||
|
||||
#include "string_piece.hh"
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
#include <exception>
|
||||
#include <sstream>
|
@ -1,6 +1,6 @@
|
||||
#include "file_piece.hh"
|
||||
#include "util/file_piece.hh"
|
||||
|
||||
#include "exception.hh"
|
||||
#include "util/exception.hh"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef UTIL_FILE_PIECE__
|
||||
#define UTIL_FILE_PIECE__
|
||||
|
||||
#include "ersatz_progress.hh"
|
||||
#include "exception.hh"
|
||||
#include "mmap.hh"
|
||||
#include "scoped.hh"
|
||||
#include "string_piece.hh"
|
||||
#include "util/ersatz_progress.hh"
|
||||
#include "util/exception.hh"
|
||||
#include "util/mmap.hh"
|
||||
#include "util/scoped.hh"
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "file_piece.hh"
|
||||
#include "util/file_piece.hh"
|
||||
|
||||
#define BOOST_TEST_MODULE FilePieceTest
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
@ -5,7 +5,7 @@
|
||||
* also permuting another range the same way.
|
||||
*/
|
||||
|
||||
#include "proxy_iterator.hh"
|
||||
#include "util/proxy_iterator.hh"
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "joint_sort.hh"
|
||||
#include "util/joint_sort.hh"
|
||||
|
||||
#define BOOST_TEST_MODULE JointSortTest
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "key_value_packing.hh"
|
||||
#include "util/key_value_packing.hh"
|
||||
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/random/uniform_int.hpp>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "exception.hh"
|
||||
#include "mmap.hh"
|
||||
#include "scoped.hh"
|
||||
#include "util/exception.hh"
|
||||
#include "util/mmap.hh"
|
||||
#include "util/scoped.hh"
|
||||
|
||||
#include <assert.h>
|
||||
#include <err.h>
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define UTIL_MMAP__
|
||||
// Utilities for mmaped files.
|
||||
|
||||
#include "scoped.hh"
|
||||
#include "util/scoped.hh"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* default option = 0 for seed
|
||||
*/
|
||||
|
||||
#include "murmur_hash.hh"
|
||||
#include "util/murmur_hash.hh"
|
||||
|
||||
namespace util {
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "probing_hash_table.hh"
|
||||
#include "util/probing_hash_table.hh"
|
||||
|
||||
#include "key_value_packing.hh"
|
||||
#include "util/key_value_packing.hh"
|
||||
|
||||
#define BOOST_TEST_MODULE ProbingHashTableTest
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "scoped.hh"
|
||||
#include "util/scoped.hh"
|
||||
|
||||
#include <err.h>
|
||||
#include <unistd.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "sorted_uniform.hh"
|
||||
#include "util/sorted_uniform.hh"
|
||||
|
||||
#include "key_value_packing.hh"
|
||||
#include "util/key_value_packing.hh"
|
||||
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/random/uniform_int.hpp>
|
||||
|
@ -28,7 +28,7 @@
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
// Copied from strings/stringpiece.cc with modifications
|
||||
|
||||
#include "../util/string_piece.hh"
|
||||
#include "util/string_piece.hh"
|
||||
|
||||
#ifdef USE_BOOST
|
||||
#include <boost/functional/hash/hash.hpp>
|
||||
|
@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#include <limits>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "ngram.hh"
|
||||
#include "lm/ngram.hh"
|
||||
|
||||
#include "LanguageModelKen.h"
|
||||
#include "TypeDef.h"
|
||||
|
Loading…
Reference in New Issue
Block a user