Welcome to mirror list, hosted at ThFree Co, Russian Federation.

InputOutput.cpp « src « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1d6b1c856bca29c747eb8dd91c60dd5c3bdc9319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// $Id$
#include "InputOutput.h"
#include "Input.h"

InputOutput::InputOutput() : sentenceId(0) {}

InputOutput::~InputOutput() {}

void InputOutput::Release(InputType *s) {delete s;}


InputType* InputOutput::GetInput(InputType *inputType
																 , std::istream &inputStream
																 , const std::vector<FactorType> &factorOrder
																 , FactorCollection &factorCollection) 
{
	if(inputType->Read(inputStream,factorOrder,factorCollection)) 
		{
			inputType->SetTranslationId(sentenceId++);
			return inputType;
		}
	else 
		{
			delete inputType;
			return 0;
		}
}