mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-29 06:52:34 +03:00
commit
5284d0b819
4
Jamroot
4
Jamroot
@ -91,10 +91,10 @@ rule test_flags ( flags ) {
|
|||||||
#Determine if a library can be compiled statically.
|
#Determine if a library can be compiled statically.
|
||||||
rule auto_shared ( name : additional ? ) {
|
rule auto_shared ( name : additional ? ) {
|
||||||
additional ?= "" ;
|
additional ?= "" ;
|
||||||
if [ test_flags $(additional)" -static -l"$(name) ] {
|
if [ test_flags $(additional)" -shared -l"$(name) ] {
|
||||||
return ;
|
return ;
|
||||||
} else {
|
} else {
|
||||||
return "<link>shared" ;
|
return "<link>static" ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ lib kenlm : bhiksha.cc binary_format.cc config.cc lm_exception.cc model.cc quant
|
|||||||
|
|
||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
run left_test.cc kenlm ..//boost_unit_test_framework : : test.arpa ;
|
run left_test.cc ../util//kenutil kenlm ..//boost_unit_test_framework : : test.arpa ;
|
||||||
run model_test.cc kenlm ..//boost_unit_test_framework : : test.arpa test_nounk.arpa ;
|
run model_test.cc ../util//kenutil kenlm ..//boost_unit_test_framework : : test.arpa test_nounk.arpa ;
|
||||||
|
|
||||||
exe query : ngram_query.cc kenlm ;
|
exe query : ngram_query.cc kenlm ../util//kenutil ;
|
||||||
exe build_binary : build_binary.cc kenlm ;
|
exe build_binary : build_binary.cc kenlm ../util//kenutil ;
|
||||||
|
|
||||||
install legacy : build_binary query
|
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 ;
|
: <location>$(TOP)/lm <install-type>EXE <install-dependencies>on <link>shared:<dll-path>$(TOP)/lm <link>shared:<install-type>LIB ;
|
||||||
|
@ -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
|
//sort hyps based on estimated scores - do so by copying to multimap
|
||||||
multimap<float, const Hypothesis*> sortHypsByVal;
|
multimap<float, const Hypothesis*> sortHypsByVal;
|
||||||
for (size_t i =0; i < estimatedScores.size(); ++i) {
|
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();
|
multimap<float, const Hypothesis*>::const_iterator it = --sortHypsByVal.end();
|
||||||
float bestScore = it->first;
|
float bestScore = it->first;
|
||||||
//store best score as score of hyp 0
|
//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) {
|
IFVERBOSE(3) {
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#define iterate(c, i) for(typeof(c.begin()) i = c.begin(); i != c.end(); ++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 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 riterate(c, i) for(__typeof__(c.rbegin()) i = c.rbegin(); i != c.rend(); ++i)
|
||||||
|
|
||||||
|
|
||||||
#define THREADED false
|
#define THREADED false
|
||||||
|
@ -4,8 +4,8 @@ local dependencies = ;
|
|||||||
|
|
||||||
local with-irstlm = [ option.get "with-irstlm" ] ;
|
local with-irstlm = [ option.get "with-irstlm" ] ;
|
||||||
if $(with-irstlm) {
|
if $(with-irstlm) {
|
||||||
lib irstlm : : <search>$(with-irstlm)/lib ;
|
lib irstlm : : <search>$(with-irstlm)/lib <search>$(with-irstlm)/lib64 ;
|
||||||
obj IRST.o : IRST.cpp ..//headers : <include>$(with-irstlm)/include ;
|
obj IRST.o : IRST.cpp ..//headers : <include>$(with-irstlm)/include <include>$(with-irstlm)/include/irstlm ;
|
||||||
alias irst : IRST.o irstlm : : : <define>LM_IRST ;
|
alias irst : IRST.o irstlm : : : <define>LM_IRST ;
|
||||||
dependencies += irst ;
|
dependencies += irst ;
|
||||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
|
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
|
||||||
@ -20,7 +20,7 @@ if $(with-srilm) {
|
|||||||
} else {
|
} else {
|
||||||
sri-arch = [ option.get "with-srilm-arch" ] ;
|
sri-arch = [ option.get "with-srilm-arch" ] ;
|
||||||
sri-arch ?= [ _shell $(with-srilm)/sbin/machine-type ] ;
|
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 flm : : $(sri-lib) ;
|
||||||
lib misc : flm : $(sri-lib) ;
|
lib misc : flm : $(sri-lib) ;
|
||||||
@ -30,16 +30,16 @@ if $(with-srilm) {
|
|||||||
alias sri-libs : oolm dstruct misc flm ;
|
alias sri-libs : oolm dstruct misc flm ;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj SRI.o : SRI.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 <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 ;
|
alias sri : SRI.o ParallelBackoff.o sri-libs : : : <define>LM_SRI ;
|
||||||
dependencies += sri ;
|
dependencies += sri ;
|
||||||
}
|
}
|
||||||
|
|
||||||
local with-randlm = [ option.get "with-randlm" ] ;
|
local with-randlm = [ option.get "with-randlm" ] ;
|
||||||
if $(with-randlm) {
|
if $(with-randlm) {
|
||||||
lib randlm : : <search>$(with-randlm)/lib ;
|
lib randlm : : <search>$(with-randlm)/lib <search>$(with-randlm)/lib64 ;
|
||||||
obj Rand.o : Rand.cpp randlm ..//headers : <include>$(with-randlm)/include ;
|
obj Rand.o : Rand.cpp randlm ..//headers : <include>$(with-randlm)/include <include>$(with-randlm)/include/randlm ;
|
||||||
alias rand : Rand.o : : : <define>LM_RAND ;
|
alias rand : Rand.o : : : <define>LM_RAND ;
|
||||||
dependencies += rand ;
|
dependencies += rand ;
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
lib RuleTable : [ glob *.cpp ] ..//headers ;
|
lib RuleTable : [ glob *.cpp ] ..//headers ..//Scope3Parser ;
|
||||||
|
@ -115,7 +115,7 @@ struct VarSpanNode
|
|||||||
key[4] = first->m_numSplitPoints;
|
key[4] = first->m_numSplitPoints;
|
||||||
|
|
||||||
std::pair<MapType::iterator, bool> result = m_children.insert(
|
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;
|
VarSpanNode &child = result.first->second;
|
||||||
if (result.second) {
|
if (result.second) {
|
||||||
child.m_parent = this;
|
child.m_parent = this;
|
||||||
|
@ -87,6 +87,7 @@ bool PhrasePairCollection::GetCollection( const vector< string > sourceString )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort(m_collection.begin(), m_collection.end(), CompareBySize());
|
sort(m_collection.begin(), m_collection.end(), CompareBySize());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhrasePairCollection::Print()
|
void PhrasePairCollection::Print()
|
||||||
|
@ -601,6 +601,7 @@ string getOrientString(REO_POS orient, REO_MODEL_TYPE modelType)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void addPhrase( SentenceAlignment &sentence, int startE, int endE, int startF, int endF , string &orientationInfo)
|
void addPhrase( SentenceAlignment &sentence, int startE, int endE, int startF, int endF , string &orientationInfo)
|
||||||
|
Loading…
Reference in New Issue
Block a user