diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-04-07 17:00:40 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-04-07 17:00:40 +0400 |
commit | 6b1e147cff4ecf54de6d57461632aa42c5e8276b (patch) | |
tree | 17af5fca94bdc19151f3b4407ee7d7cfcf4881b8 /moses/TreeInput.cpp | |
parent | 5d616397630ca66a0121fa8411113c976e4b7621 (diff) |
add -default-non-term-for-empty-range-only
Diffstat (limited to 'moses/TreeInput.cpp')
-rw-r--r-- | moses/TreeInput.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/moses/TreeInput.cpp b/moses/TreeInput.cpp index 443b52ab8..44a119dac 100644 --- a/moses/TreeInput.cpp +++ b/moses/TreeInput.cpp @@ -265,7 +265,10 @@ int TreeInput::Read(std::istream& in,const std::vector<FactorType>& factorOrder) // default label for (size_t startPos = 0; startPos < sourceSize; ++startPos) { for (size_t endPos = startPos; endPos < sourceSize; ++endPos) { - AddChartLabel(startPos, endPos, staticData.GetInputDefaultNonTerminal(), factorOrder); + NonTerminalSet &list = GetLabelSet(startPos, endPos); + if (list.size() == 0 || !staticData.GetDefaultNonTermOnlyForEmptyRange()) { + AddChartLabel(startPos, endPos, staticData.GetInputDefaultNonTerminal(), factorOrder); + } } } |