skeleton PT

This commit is contained in:
Hieu Hoang 2013-09-25 20:59:13 +01:00
parent 56c1224c28
commit 847f7c1ea2
5 changed files with 130 additions and 8 deletions

View File

@ -1756,6 +1756,16 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerOnDisk.h</locationURI>
</link>
<link>
<name>TranslationModel/CYKPlusParser/ChartRuleLookupManagerSkeleton.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerSkeleton.cpp</locationURI>
</link>
<link>
<name>TranslationModel/CYKPlusParser/ChartRuleLookupManagerSkeleton.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerSkeleton.h</locationURI>
</link>
<link>
<name>TranslationModel/CYKPlusParser/DotChart.h</name>
<type>1</type>

View File

@ -8,6 +8,10 @@
namespace Moses
{
enum ControlRecombinationType
{
};
class ControlRecombinationState : public FFState
{
@ -35,7 +39,6 @@ class ControlRecombination : public StatefulFeatureFunction
public:
ControlRecombination(const std::string &line)
:StatefulFeatureFunction("ControlRecombination", 1, line)
,m_maxUnknowns(0)
{
m_tuneable = false;
ReadParameters();
@ -76,10 +79,6 @@ public:
void SetParameter(const std::string& key, const std::string& value);
protected:
std::string m_path;
std::map<long,Phrase> m_constraints;
int m_maxUnknowns;
};

View File

@ -0,0 +1,56 @@
/***********************************************************************
Moses - factored phrase-based language decoder
Copyright (C) 2011 University of Edinburgh
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
#include <iostream>
#include "ChartRuleLookupManagerSkeleton.h"
#include "DotChartInMemory.h"
#include "moses/ChartParser.h"
#include "moses/InputType.h"
#include "moses/ChartParserCallback.h"
#include "moses/StaticData.h"
#include "moses/NonTerminal.h"
#include "moses/ChartCellCollection.h"
#include "moses/TranslationModel/PhraseDictionaryMemory.h"
using namespace std;
namespace Moses
{
ChartRuleLookupManagerSkeleton::ChartRuleLookupManagerSkeleton(
const ChartParser &parser,
const ChartCellCollectionBase &cellColl,
const SkeletonPT &ruleTable)
: ChartRuleLookupManagerCYKPlus(parser, cellColl)
{
}
ChartRuleLookupManagerSkeleton::~ChartRuleLookupManagerSkeleton()
{
}
void ChartRuleLookupManagerSkeleton::GetChartRuleCollection(
const WordsRange &range,
ChartParserCallback &outColl)
{
}
} // namespace Moses

View File

@ -0,0 +1,56 @@
/***********************************************************************
Moses - factored phrase-based language decoder
Copyright (C) 2011 University of Edinburgh
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
#pragma once
#include <vector>
#ifdef USE_BOOST_POOL
#include <boost/pool/object_pool.hpp>
#endif
#include "ChartRuleLookupManagerCYKPlus.h"
namespace Moses
{
class ChartParserCallback;
class DottedRuleColl;
class WordsRange;
class SkeletonPT;
//! Implementation of ChartRuleLookupManager for in-memory rule tables.
class ChartRuleLookupManagerSkeleton : public ChartRuleLookupManagerCYKPlus
{
public:
ChartRuleLookupManagerSkeleton(const ChartParser &parser,
const ChartCellCollectionBase &cellColl,
const SkeletonPT &ruleTable);
~ChartRuleLookupManagerSkeleton();
virtual void GetChartRuleCollection(
const WordsRange &range,
ChartParserCallback &outColl);
private:
};
} // namespace Moses

View File

@ -1,5 +1,6 @@
// vim:tabstop=2
#include "SkeletonPT.h"
#include "moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerSkeleton.h"
using namespace std;
@ -54,10 +55,10 @@ TargetPhrase *SkeletonPT::CreateTargetPhrase(const Phrase &sourcePhrase) const
return tp;
}
ChartRuleLookupManager* SkeletonPT::CreateRuleLookupManager(const ChartParser&,
const ChartCellCollectionBase&)
ChartRuleLookupManager* SkeletonPT::CreateRuleLookupManager(const ChartParser &parser,
const ChartCellCollectionBase &cellCollection)
{
CHECK(false);
return new ChartRuleLookupManagerSkeleton(parser, cellCollection, *this);
}
TO_STRING_BODY(SkeletonPT);