Merge pull request #9 from miska/master

Few compilation fixes
This commit is contained in:
Hieu Hoang 2012-02-03 01:25:33 -08:00
commit 5284d0b819
9 changed files with 22 additions and 20 deletions

View File

@ -91,10 +91,10 @@ rule test_flags ( flags ) {
#Determine if a library can be compiled statically.
rule auto_shared ( name : additional ? ) {
additional ?= "" ;
if [ test_flags $(additional)" -static -l"$(name) ] {
if [ test_flags $(additional)" -shared -l"$(name) ] {
return ;
} else {
return "<link>shared" ;
return "<link>static" ;
}
}

View File

@ -2,11 +2,11 @@ lib kenlm : bhiksha.cc binary_format.cc config.cc lm_exception.cc model.cc quant
import testing ;
run left_test.cc kenlm ..//boost_unit_test_framework : : test.arpa ;
run model_test.cc kenlm ..//boost_unit_test_framework : : test.arpa test_nounk.arpa ;
run left_test.cc ../util//kenutil kenlm ..//boost_unit_test_framework : : test.arpa ;
run model_test.cc ../util//kenutil kenlm ..//boost_unit_test_framework : : test.arpa test_nounk.arpa ;
exe query : ngram_query.cc kenlm ;
exe build_binary : build_binary.cc kenlm ;
exe query : ngram_query.cc kenlm ../util//kenutil ;
exe build_binary : build_binary.cc kenlm ../util//kenutil ;
install legacy : build_binary query
: <location>$(TOP)/lm <install-type>EXE <install-dependencies>on <link>shared:<dll-path>$(TOP)/lm <link>shared:<install-type>LIB ;

View File

@ -148,13 +148,13 @@ void pruneLatticeFB(Lattice & connectedHyp, map < const Hypothesis*, set <const
//sort hyps based on estimated scores - do so by copying to multimap
multimap<float, const Hypothesis*> sortHypsByVal;
for (size_t i =0; i < estimatedScores.size(); ++i) {
sortHypsByVal.insert(make_pair<float, const Hypothesis*>(estimatedScores[i], connectedHyp[i]));
sortHypsByVal.insert(make_pair(estimatedScores[i], connectedHyp[i]));
}
multimap<float, const Hypothesis*>::const_iterator it = --sortHypsByVal.end();
float bestScore = it->first;
//store best score as score of hyp 0
sortHypsByVal.insert(make_pair<float, const Hypothesis*>(bestScore, emptyHyp));
sortHypsByVal.insert(make_pair(bestScore, emptyHyp));
IFVERBOSE(3) {

View File

@ -7,9 +7,9 @@
#include <vector>
#include <typeinfo>
#include <stdint.h>
#define iterate(c, i) for(typeof(c.begin()) i = c.begin(); i != c.end(); ++i)
#define piterate(c, i) for(typeof(c->begin()) i = c->begin(); i != c->end(); ++i)
#define riterate(c, i) for(typeof(c.rbegin()) i = c.rbegin(); i != c.rend(); ++i)
#define iterate(c, i) for(__typeof__(c.begin()) i = c.begin(); i != c.end(); ++i)
#define piterate(c, i) for(__typeof__(c->begin()) i = c->begin(); i != c->end(); ++i)
#define riterate(c, i) for(__typeof__(c.rbegin()) i = c.rbegin(); i != c.rend(); ++i)
#define THREADED false

View File

@ -4,8 +4,8 @@ local dependencies = ;
local with-irstlm = [ option.get "with-irstlm" ] ;
if $(with-irstlm) {
lib irstlm : : <search>$(with-irstlm)/lib ;
obj IRST.o : IRST.cpp ..//headers : <include>$(with-irstlm)/include ;
lib irstlm : : <search>$(with-irstlm)/lib <search>$(with-irstlm)/lib64 ;
obj IRST.o : IRST.cpp ..//headers : <include>$(with-irstlm)/include <include>$(with-irstlm)/include/irstlm ;
alias irst : IRST.o irstlm : : : <define>LM_IRST ;
dependencies += irst ;
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
@ -20,7 +20,7 @@ if $(with-srilm) {
} else {
sri-arch = [ option.get "with-srilm-arch" ] ;
sri-arch ?= [ _shell $(with-srilm)/sbin/machine-type ] ;
sri-lib = <search>$(with-srilm)/lib/$(sri-arch) <search>$(with-srilm)/flm/obj/$(sri-arch) ;
sri-lib = <search>$(with-srilm)/lib/$(sri-arch) <search>$(with-srilm)/lib <search>$(with-srilm)/lib64 <search>$(with-srilm)/flm/obj/$(sri-arch) ;
lib flm : : $(sri-lib) ;
lib misc : flm : $(sri-lib) ;
@ -30,16 +30,16 @@ if $(with-srilm) {
alias sri-libs : oolm dstruct misc flm ;
}
obj SRI.o : SRI.cpp ..//headers : <include>$(with-srilm)/include <warnings>off ;
obj ParallelBackoff.o : ParallelBackoff.cpp ..//headers : <include>$(with-srilm)/include <warnings>off ;
obj SRI.o : SRI.cpp ..//headers : <include>$(with-srilm)/include <include>$(with-srilm)/include/srilm <warnings>off ;
obj ParallelBackoff.o : ParallelBackoff.cpp ..//headers : <include>$(with-srilm)/include <include>$(with-srilm)/include/srilm <warnings>off ;
alias sri : SRI.o ParallelBackoff.o sri-libs : : : <define>LM_SRI ;
dependencies += sri ;
}
local with-randlm = [ option.get "with-randlm" ] ;
if $(with-randlm) {
lib randlm : : <search>$(with-randlm)/lib ;
obj Rand.o : Rand.cpp randlm ..//headers : <include>$(with-randlm)/include ;
lib randlm : : <search>$(with-randlm)/lib <search>$(with-randlm)/lib64 ;
obj Rand.o : Rand.cpp randlm ..//headers : <include>$(with-randlm)/include <include>$(with-randlm)/include/randlm ;
alias rand : Rand.o : : : <define>LM_RAND ;
dependencies += rand ;
}

View File

@ -1 +1 @@
lib RuleTable : [ glob *.cpp ] ..//headers ;
lib RuleTable : [ glob *.cpp ] ..//headers ..//Scope3Parser ;

View File

@ -115,7 +115,7 @@ struct VarSpanNode
key[4] = first->m_numSplitPoints;
std::pair<MapType::iterator, bool> result = m_children.insert(
std::make_pair<KeyType, VarSpanNode>(key, VarSpanNode()));
std::make_pair(key, VarSpanNode()));
VarSpanNode &child = result.first->second;
if (result.second) {
child.m_parent = this;

View File

@ -87,6 +87,7 @@ bool PhrasePairCollection::GetCollection( const vector< string > sourceString )
}
}
sort(m_collection.begin(), m_collection.end(), CompareBySize());
return true;
}
void PhrasePairCollection::Print()

View File

@ -601,6 +601,7 @@ string getOrientString(REO_POS orient, REO_MODEL_TYPE modelType)
}
break;
}
return "";
}
void addPhrase( SentenceAlignment &sentence, int startE, int endE, int startF, int endF , string &orientationInfo)