move TranslationTask into moses/

This commit is contained in:
Hieu Hoang 2014-09-30 12:59:31 +01:00
parent ebd2e72494
commit c20af584e7
13 changed files with 34 additions and 35 deletions

View File

@ -101,16 +101,6 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses-chart-cmd/Main.h</locationURI>
</link>
<link>
<name>TranslationTask.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses-chart-cmd/TranslationTask.cpp</locationURI>
</link>
<link>
<name>TranslationTask.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses-chart-cmd/TranslationTask.h</locationURI>
</link>
<link>
<name>mbr.cpp</name>
<type>1</type>

View File

@ -106,16 +106,6 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses-cmd/Main.h</locationURI>
</link>
<link>
<name>TranslationTask.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses-cmd/TranslationTask.cpp</locationURI>
</link>
<link>
<name>TranslationTask.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses-cmd/TranslationTask.h</locationURI>
</link>
<link>
<name>mbr.cpp</name>
<type>1</type>

View File

@ -916,6 +916,26 @@
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationOptionList.h</locationURI>
</link>
<link>
<name>TranslationTask.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationTask.cpp</locationURI>
</link>
<link>
<name>TranslationTask.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationTask.h</locationURI>
</link>
<link>
<name>TranslationTaskChart.cpp</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationTaskChart.cpp</locationURI>
</link>
<link>
<name>TranslationTaskChart.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/moses/TranslationTaskChart.h</locationURI>
</link>
<link>
<name>TreeInput.cpp</name>
<type>1</type>

View File

@ -1,2 +1,2 @@
exe moses_chart : Main.cpp mbr.cpp TranslationTask.cpp ../moses//moses $(TOP)//boost_iostreams ..//boost_filesystem ..//z ;
exe moses_chart : Main.cpp mbr.cpp ../moses//moses $(TOP)//boost_iostreams ..//boost_filesystem ..//z ;

View File

@ -59,11 +59,11 @@ POSSIBILITY OF SUCH DAMAGE.
#include "moses/ChartHypothesis.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
#include "moses/TranslationTaskChart.h"
#include "util/usage.hh"
#include "util/exception.hh"
#include "TranslationTask.h"
using namespace std;
@ -191,7 +191,7 @@ int main(int argc, char* argv[])
FeatureFunction::CallChangeSource(source);
TranslationTask *task = new TranslationTask(source, *ioWrapper, hypergraphOutput);
TranslationTaskChart *task = new TranslationTaskChart(source, *ioWrapper, hypergraphOutput);
source = NULL; // task will delete source
#ifdef WITH_THREADS
pool.Submit(task); // pool will delete task

View File

@ -1,4 +1,4 @@
alias deps : mbr.cpp TranslationTask.cpp ..//z ..//boost_iostreams ..//boost_filesystem ../moses//moses ;
alias deps : ..//z ..//boost_iostreams ..//boost_filesystem ../moses//moses ;
exe moses : Main.cpp deps ;
exe lmbrgrid : LatticeMBRGrid.cpp deps ;

View File

@ -45,8 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "moses/TranslationModel/PhraseDictionary.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
#include "TranslationTask.h"
#include "moses/TranslationTask.h"
#ifdef HAVE_PROTOBUF
#include "hypergraph.pb.h"

View File

@ -1,4 +1,4 @@
#include "TranslationTask.h"
#include "TranslationTaskChart.h"
#include "moses/Sentence.h"
#include "moses/StaticData.h"
#include "moses/Incremental.h"
@ -9,18 +9,18 @@ using namespace std;
using namespace Moses;
using namespace MosesChartCmd;
TranslationTask::TranslationTask(InputType *source, IOWrapperChart &ioWrapper,
TranslationTaskChart::TranslationTaskChart(InputType *source, IOWrapperChart &ioWrapper,
boost::shared_ptr<HypergraphOutput<ChartManager> > hypergraphOutput)
: m_source(source)
, m_ioWrapper(ioWrapper)
, m_hypergraphOutput(hypergraphOutput)
{}
TranslationTask::~TranslationTask() {
TranslationTaskChart::~TranslationTaskChart() {
delete m_source;
}
void TranslationTask::Run() {
void TranslationTaskChart::Run() {
const StaticData &staticData = StaticData::Instance();
const size_t translationId = m_source->GetTranslationId();

View File

@ -19,20 +19,20 @@ namespace MosesChartCmd
/**
* Translates a sentence.
**/
class TranslationTask : public Moses::Task
class TranslationTaskChart : public Moses::Task
{
public:
TranslationTask(Moses::InputType *source, MosesChartCmd::IOWrapperChart &ioWrapper,
TranslationTaskChart(Moses::InputType *source, MosesChartCmd::IOWrapperChart &ioWrapper,
boost::shared_ptr<Moses::HypergraphOutput<Moses::ChartManager> > hypergraphOutput);
~TranslationTask();
~TranslationTaskChart();
void Run();
private:
// Non-copyable: copy constructor and assignment operator not implemented.
TranslationTask(const TranslationTask &);
TranslationTask &operator=(const TranslationTask &);
TranslationTaskChart(const TranslationTaskChart &);
TranslationTaskChart &operator=(const TranslationTaskChart &);
Moses::InputType *m_source;
MosesChartCmd::IOWrapperChart &m_ioWrapper;