mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Fix more conflations, update lazy
This commit is contained in:
parent
3291083be7
commit
e75b51bb73
@ -175,8 +175,7 @@ public:
|
||||
stringstream out, graphInfo, transCollOpts;
|
||||
map<string, xmlrpc_c::value> retData;
|
||||
|
||||
SearchAlgorithm searchAlgorithm = staticData.GetSearchAlgorithm();
|
||||
if (searchAlgorithm == ChartDecoding) {
|
||||
if (staticData.IsChart()) {
|
||||
TreeInput tinput;
|
||||
const vector<FactorType> &inputFactorOrder =
|
||||
staticData.GetInputFactorOrder();
|
||||
|
2
lazy
2
lazy
@ -1 +1 @@
|
||||
Subproject commit a66f6cd85d3705649d713a51b6ed4ab946dd2d60
|
||||
Subproject commit 8a22cd709241ae598d6e29098fd072a9dee9d59e
|
@ -233,7 +233,7 @@ int main(int argc, char* argv[])
|
||||
exit(0);
|
||||
}
|
||||
|
||||
CHECK(staticData.GetSearchAlgorithm() == ChartDecoding || staticData.GetSearchAlgorithm() == ChartIncremental);
|
||||
CHECK(staticData.IsChart());
|
||||
|
||||
// set up read/writing class
|
||||
IOWrapper *ioWrapper = GetIOWrapper(staticData);
|
||||
|
@ -38,7 +38,7 @@ Sentence::Sentence()
|
||||
, InputType()
|
||||
{
|
||||
const StaticData& staticData = StaticData::Instance();
|
||||
if (staticData.GetSearchAlgorithm() == ChartDecoding) {
|
||||
if (staticData.IsChart()) {
|
||||
m_defaultLabelSet.insert(StaticData::Instance().GetInputDefaultNonTerminal());
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ int Sentence::Read(std::istream& in,const std::vector<FactorType>& factorOrder)
|
||||
}
|
||||
Phrase::CreateFromString(factorOrder, line, factorDelimiter);
|
||||
|
||||
if (staticData.GetSearchAlgorithm() == ChartDecoding) {
|
||||
if (staticData.IsChart()) {
|
||||
InitStartEndWord();
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ bool StaticData::LoadData(Parameter *parameter)
|
||||
m_searchAlgorithm = (m_parameter->GetParam("search-algorithm").size() > 0) ?
|
||||
(SearchAlgorithm) Scan<size_t>(m_parameter->GetParam("search-algorithm")[0]) : Normal;
|
||||
|
||||
if (m_searchAlgorithm == ChartDecoding || m_searchAlgorithm == ChartIncremental)
|
||||
if (IsChart())
|
||||
LoadChartDecodingParameters();
|
||||
else
|
||||
LoadPhraseBasedParameters();
|
||||
@ -544,7 +544,7 @@ bool StaticData::LoadData(Parameter *parameter)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_searchAlgorithm == ChartDecoding || m_searchAlgorithm == ChartIncremental) {
|
||||
if (IsChart()) {
|
||||
//insert some null distortion score producers
|
||||
m_distortionScoreProducers.assign(tsConfig.size(), NULL);
|
||||
} else {
|
||||
@ -1255,7 +1255,7 @@ bool StaticData::LoadDecodeGraphs()
|
||||
CHECK(decodeStep);
|
||||
if (m_decodeGraphs.size() < decodeGraphInd + 1) {
|
||||
DecodeGraph *decodeGraph;
|
||||
if (m_searchAlgorithm == ChartDecoding || m_searchAlgorithm == ChartIncremental) {
|
||||
if (IsChart()) {
|
||||
size_t maxChartSpan = (decodeGraphInd < maxChartSpans.size()) ? maxChartSpans[decodeGraphInd] : DEFAULT_MAX_CHART_SPAN;
|
||||
decodeGraph = new DecodeGraph(m_decodeGraphs.size(), maxChartSpan);
|
||||
} else {
|
||||
|
@ -451,6 +451,9 @@ public:
|
||||
SearchAlgorithm GetSearchAlgorithm() const {
|
||||
return m_searchAlgorithm;
|
||||
}
|
||||
bool IsChart() const {
|
||||
return m_searchAlgorithm == ChartDecoding || m_searchAlgorithm == ChartIncremental;
|
||||
}
|
||||
LMList GetLMList() const {
|
||||
return m_languageModel;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user