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:
authorHieu Hoang <hieuhoang@gmail.com>2014-10-07 22:16:30 +0400
committerHieu Hoang <hieuhoang@gmail.com>2014-10-07 22:16:30 +0400
commit433186ae255ec2e446e067530bee26a8ec11afcd (patch)
tree16cc563343ae3d4490055aa48948f53caa66fabf /moses-cmd
parent0d7048803a44d8481528cf1264f5513e8eb94571 (diff)
delete lineNumber variable from Manager and TranslationTask. It should always be carried by the input sentence itself
Diffstat (limited to 'moses-cmd')
-rw-r--r--moses-cmd/LatticeMBRGrid.cpp7
-rw-r--r--moses-cmd/Main.cpp3
2 files changed, 6 insertions, 4 deletions
diff --git a/moses-cmd/LatticeMBRGrid.cpp b/moses-cmd/LatticeMBRGrid.cpp
index 3573d0697..677adb791 100644
--- a/moses-cmd/LatticeMBRGrid.cpp
+++ b/moses-cmd/LatticeMBRGrid.cpp
@@ -159,7 +159,7 @@ int main(int argc, char* argv[])
StaticData& staticData = const_cast<StaticData&>(StaticData::Instance());
staticData.SetUseLatticeMBR(true);
- IOWrapper* ioWrapper = GetIOWrapper(staticData);
+ IOWrapper* ioWrapper = IOWrapper::GetIOWrapper(staticData);
if (!ioWrapper) {
throw runtime_error("Failed to initialise IOWrapper");
@@ -180,8 +180,9 @@ int main(int argc, char* argv[])
while(ReadInput(*ioWrapper,staticData.GetInputType(),source)) {
++lineCount;
- Sentence sentence;
- Manager manager(lineCount, *source, staticData.GetSearchAlgorithm());
+ source->SetTranslationId(lineCount);
+
+ Manager manager(*source, staticData.GetSearchAlgorithm());
manager.ProcessSentence();
TrellisPathList nBestList;
manager.CalcNBest(nBestSize, nBestList,true);
diff --git a/moses-cmd/Main.cpp b/moses-cmd/Main.cpp
index 994837d4a..513c3a187 100644
--- a/moses-cmd/Main.cpp
+++ b/moses-cmd/Main.cpp
@@ -142,6 +142,7 @@ int main(int argc, char** argv)
InputType* source = NULL;
size_t lineCount = staticData.GetStartTranslationId();
while(ReadInput(*ioWrapper,staticData.GetInputType(),source)) {
+ source->SetTranslationId(lineCount);
IFVERBOSE(1) {
ResetUserTime();
}
@@ -150,7 +151,7 @@ int main(int argc, char** argv)
// set up task of translating one sentence
TranslationTask* task =
- new TranslationTask(lineCount,source, *ioWrapper,
+ new TranslationTask(source, *ioWrapper,
staticData.GetOutputSearchGraphSLF(),
hypergraphOutput);
// execute task