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

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Germann <ugermann@inf.ed.ac.uk>2015-03-15 23:38:31 +0300
committerUlrich Germann <ugermann@inf.ed.ac.uk>2015-03-15 23:38:31 +0300
commitad805c133bb61dac3b9d1555d221db71739d90d4 (patch)
tree1937e47b012c7e97df6308627c805ec5e514ed17 /moses/IOWrapper.cpp
parent16d8ef67f0f2c350dbdc071a5102084d48c44600 (diff)
Instances of InputType (and derived classes) now know which TranslationTask (if any) created them.
This is a first step towards providing phrase tables etc. access to context information etc. associated with specific translation tasks.
Diffstat (limited to 'moses/IOWrapper.cpp')
-rw-r--r--moses/IOWrapper.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/moses/IOWrapper.cpp b/moses/IOWrapper.cpp
index 925d1bc41..99897e289 100644
--- a/moses/IOWrapper.cpp
+++ b/moses/IOWrapper.cpp
@@ -235,27 +235,31 @@ GetInput(InputType* inputType)
}
}
-bool IOWrapper::ReadInput(InputTypeEnum inputType, InputType*& source)
+bool
+IOWrapper
+::ReadInput(InputTypeEnum inputType,
+ InputType*& source,
+ TranslationTask const* ttask)
{
delete source;
switch(inputType) {
case SentenceInput:
- source = GetInput(new Sentence);
+ source = GetInput(new Sentence(ttask));
break;
case ConfusionNetworkInput:
- source = GetInput(new ConfusionNet);
+ source = GetInput(new ConfusionNet(ttask));
break;
case WordLatticeInput:
- source = GetInput(new WordLattice);
+ source = GetInput(new WordLattice(ttask));
break;
case TreeInputType:
- source = GetInput(new TreeInput);
+ source = GetInput(new TreeInput(ttask));
break;
case TabbedSentenceInput:
- source = GetInput(new TabbedSentence);
+ source = GetInput(new TabbedSentence(ttask));
break;
case ForestInputType:
- source = GetInput(new ForestInput);
+ source = GetInput(new ForestInput(ttask));
break;
default:
TRACE_ERR("Unknown input type: " << inputType << "\n");