diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-12 19:23:37 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-14 01:31:43 +0300 |
commit | bb6e0157aac67e72b4aacbb87405014da552e140 (patch) | |
tree | 0fddd3da357960f41450378f48f033596ba34999 /moses/ChartParser.cpp | |
parent | b899ab8175d5bb3733aa65a0658633c86aa2e237 (diff) |
Code cleanup and refactoring.
Diffstat (limited to 'moses/ChartParser.cpp')
-rw-r--r-- | moses/ChartParser.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/moses/ChartParser.cpp b/moses/ChartParser.cpp index 60899c02d..15b18a7cc 100644 --- a/moses/ChartParser.cpp +++ b/moses/ChartParser.cpp @@ -237,7 +237,10 @@ void ChartParser::CreateInputPaths(const InputType &input) m_inputPathMatrix.resize(size); UTIL_THROW_IF2(input.GetType() != SentenceInput && input.GetType() != TreeInputType, - "Input must be a sentence or a tree, not lattice or confusion networks"); + "Input must be a sentence or a tree, " << + "not lattice or confusion networks"); + + TranslationTask const* ttask = m_ttask.lock().get(); for (size_t phaseSize = 1; phaseSize <= size; ++phaseSize) { for (size_t startPos = 0; startPos < size - phaseSize + 1; ++startPos) { size_t endPos = startPos + phaseSize -1; @@ -249,11 +252,11 @@ void ChartParser::CreateInputPaths(const InputType &input) InputPath *node; if (range.GetNumWordsCovered() == 1) { - node = new InputPath(m_ttask, subphrase, labels, range, NULL, NULL); + node = new InputPath(ttask, subphrase, labels, range, NULL, NULL); vec.push_back(node); } else { const InputPath &prevNode = GetInputPath(startPos, endPos - 1); - node = new InputPath(m_ttask, subphrase, labels, range, &prevNode, NULL); + node = new InputPath(ttask, subphrase, labels, range, &prevNode, NULL); vec.push_back(node); } |