delete m_translationId variable

This commit is contained in:
Hieu Hoang 2014-10-09 11:12:59 +01:00
parent c21ae90943
commit d744400a33
3 changed files with 4 additions and 9 deletions

View File

@ -146,8 +146,10 @@ int main(int argc, char* argv[])
#endif #endif
// read each sentence & decode // read each sentence & decode
InputType *source=0; InputType *source=NULL;
size_t lineCount = staticData.GetStartTranslationId();
while(ReadInput(*ioWrapper,staticData.GetInputType(),source)) { while(ReadInput(*ioWrapper,staticData.GetInputType(),source)) {
source->SetTranslationId(lineCount);
IFVERBOSE(1) IFVERBOSE(1)
ResetUserTime(); ResetUserTime();
@ -161,6 +163,7 @@ int main(int argc, char* argv[])
task->Run(); task->Run();
delete task; delete task;
#endif #endif
++lineCount;
} }
#ifdef WITH_THREADS #ifdef WITH_THREADS

View File

@ -215,10 +215,6 @@ IOWrapper::
GetInput(InputType* inputType) GetInput(InputType* inputType)
{ {
if(inputType->Read(*m_inputStream, m_inputFactorOrder)) { if(inputType->Read(*m_inputStream, m_inputFactorOrder)) {
if (long x = inputType->GetTranslationId()) {
if (x>=m_translationId) m_translationId = x+1;
} else inputType->SetTranslationId(m_translationId++);
return inputType; return inputType;
} else { } else {
delete inputType; delete inputType;

View File

@ -169,10 +169,6 @@ void IOWrapperChart::ResetTranslationId()
InputType*IOWrapperChart::GetInput(InputType* inputType) InputType*IOWrapperChart::GetInput(InputType* inputType)
{ {
if(inputType->Read(*m_inputStream, m_inputFactorOrder)) { if(inputType->Read(*m_inputStream, m_inputFactorOrder)) {
if (long x = inputType->GetTranslationId()) {
if (x>=m_translationId) m_translationId = x+1;
} else inputType->SetTranslationId(m_translationId++);
return inputType; return inputType;
} else { } else {
delete inputType; delete inputType;