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

Input.h « src « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c152ba4b2ea832007f487d8e62c7321673de652d (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// $Id$

#ifndef INPUT_H_
#define INPUT_H_
#include <string>
#include "TypeDef.h"
#include "Phrase.h"
#include "TargetPhraseCollection.h"

class WordsRange;
class Factor;
class PhraseDictionaryBase;
class TranslationOptionCollection;

// base class for sentences and confusion networks
class InputType 
{
protected:
	long m_translationId;
 public:

	InputType(long translationId=0);
	virtual ~InputType();

	// for db stuff
	long GetTranslationId()
	{
		return m_translationId;
	}
	void SetTranslationId(long translationId)
	{	// for db stuff;
		m_translationId = translationId;
	}
	virtual size_t GetSize() const=0; 

	virtual int Read(std::istream& in,const std::vector<FactorType>& factorOrder, FactorCollection &factorCollection) =0;

	virtual void Print(std::ostream&) const=0;

	virtual TargetPhraseCollection const* CreateTargetPhraseCollection(PhraseDictionaryBase const& d,const WordsRange& r) const=0;
	virtual TranslationOptionCollection* CreateTranslationOptionCollection() const=0;

	virtual Phrase GetSubString(const WordsRange&) const =0;
	virtual std::string GetStringRep(const WordsRange&) const=0;
	virtual const FactorArray& GetFactorArray(size_t pos) const=0;
	
	TO_STRING;
	
};

std::ostream& operator<<(std::ostream&,InputType const&);
#endif