summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@Chriss-MacBook-Air.local>2013-11-10 13:22:23 -0500
committerChris Dyer <cdyer@Chriss-MacBook-Air.local>2013-11-10 13:22:23 -0500
commit73a5e89074c7a531caee6faa72cfd9c22dafa43e (patch)
treee7795c4e710637af708f5d2212b991e2fac0c4aa
parent5ca9348b98a519015c4080186ea1a6fe42ef4a2b (diff)
fix for mavericks
-rw-r--r--Makefile.am7
-rw-r--r--configure.ac6
-rw-r--r--decoder/ff_context.cc2
-rw-r--r--decoder/phrasebased_translator.cc9
-rw-r--r--mteval/ns.cc2
-rw-r--r--mteval/scorer.cc2
6 files changed, 16 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index 1c30a6ff..3438c0a4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,12 +14,13 @@ SUBDIRS = \
training \
training/liblbfgs \
word-aligner \
- example_extff \
- extractor
+ example_extff
+
+# extractor
#gi/pyp-topics/src gi/clda/src gi/posterior-regularisation/prjava
-EXTRA_DIST = corpus tests python/pkg python/src python/tests python/examples compound-split environment
+EXTRA_DIST = corpus tests python/tests python/examples compound-split environment
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -D_GLIBCXX_PARALLEL -march=native -mtune=native -O2 -pipe -fomit-frame-pointer -Wall
diff --git a/configure.ac b/configure.ac
index e4183c15..9c3e692b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,13 +185,13 @@ AC_CHECK_HEADER(google/dense_hash_map,
AC_PROG_INSTALL
-CPPFLAGS="-DPIC -fPIC $CXX11_SWITCH $CPPFLAGS -DHAVE_CONFIG_H -DKENLM_MAX_ORDER=6"
+CPPFLAGS="-DPIC -fPIC $CPPFLAGS -DHAVE_CONFIG_H -DKENLM_MAX_ORDER=6"
+CXXFLAGS="$CXX11_SWITCH $CXXFLAGS"
if test "x$HAVE_CXX11" = "x0"; then
CPPFLAGS="$CPPFLAGS -DHAVE_OLD_CPP"
fi
-
# core cdec stuff
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([utils/Makefile])
@@ -199,7 +199,7 @@ AC_CONFIG_FILES([mteval/Makefile])
AC_CONFIG_FILES([mteval/meteor_jar.cc])
AC_CONFIG_FILES([decoder/Makefile])
AC_CONFIG_FILES([python/setup.py])
-AC_CONFIG_FILES([extractor/Makefile])
+# AC_CONFIG_FILES([extractor/Makefile])
AC_CONFIG_FILES([word-aligner/Makefile])
# KenLM stuff
diff --git a/decoder/ff_context.cc b/decoder/ff_context.cc
index f2b0e67c..e56f6f1f 100644
--- a/decoder/ff_context.cc
+++ b/decoder/ff_context.cc
@@ -46,7 +46,7 @@ void RuleContextFeatures::ReplaceMacroWithString(
macro << relative_location << "]";
int macro_index = feature_instance.find(macro.str());
if (macro_index == string::npos) {
- cerr << "Can't find macro " << macro << " in feature template "
+ cerr << "Can't find macro " << macro.str() << " in feature template "
<< feature_instance;
abort();
}
diff --git a/decoder/phrasebased_translator.cc b/decoder/phrasebased_translator.cc
index 04b3e5d2..8048248e 100644
--- a/decoder/phrasebased_translator.cc
+++ b/decoder/phrasebased_translator.cc
@@ -54,10 +54,13 @@ struct Coverage : public vector<bool> {
};
struct CoverageHash {
size_t operator()(const Coverage& cov) const {
- return hasher_(static_cast<const vector<bool>&>(cov));
+ int seed = 131;
+ size_t res = 0;
+ for (vector<bool>::const_iterator it = cov.begin(); it != cov.end(); ++it) {
+ res = (res * seed) + (*it + 1);
+ }
+ return res;
}
- private:
- boost::hash<vector<bool> > hasher_;
};
ostream& operator<<(ostream& os, const Coverage& cov) {
os << '[';
diff --git a/mteval/ns.cc b/mteval/ns.cc
index b64d4798..c1ea238b 100644
--- a/mteval/ns.cc
+++ b/mteval/ns.cc
@@ -106,7 +106,7 @@ struct BleuSegmentEvaluator : public SegmentEvaluator {
}
struct NGramCompare {
- int operator() (const vector<WordID>& a, const vector<WordID>& b) {
+ int operator() (const vector<WordID>& a, const vector<WordID>& b) const {
const size_t as = a.size();
const size_t bs = b.size();
const size_t s = (as < bs ? as : bs);
diff --git a/mteval/scorer.cc b/mteval/scorer.cc
index 9eb9a76e..fedbca91 100644
--- a/mteval/scorer.cc
+++ b/mteval/scorer.cc
@@ -198,7 +198,7 @@ class BLEUScorerBase : public SentenceScorer {
virtual float ComputeRefLength(const vector<WordID>& hyp) const = 0;
private:
struct NGramCompare {
- int operator() (const vector<WordID>& a, const vector<WordID>& b) {
+ int operator() (const vector<WordID>& a, const vector<WordID>& b) const {
size_t as = a.size();
size_t bs = b.size();
const size_t s = (as < bs ? as : bs);