Commit 817bb319 authored by Franck Dary's avatar Franck Dary
Browse files

In ContextModule : left-most and right-most child features are only taken into...

In ContextModule : left-most and right-most child features are only taken into account if they are respectively to the left or to the right of their parents
parent e9c3b9aa
......@@ -85,12 +85,22 @@ void ContextModuleImpl::addToContext(std::vector<std::vector<long>> & context, c
{
int childIndex = *std::get<2>(target);
auto childs = util::split(config.getAsFeature(Config::childsColName, baseIndex).get(), '|');
int candidate = -1;
if (childIndex >= 0 and childIndex < (int)childs.size())
contextIndexes.emplace_back(std::stoi(childs[childIndex]));
{
candidate = std::stoi(childs[childIndex]);
if (candidate > baseIndex)
candidate = -1;
}
else if (childIndex < 0 and ((int)childs.size())+childIndex >= 0)
contextIndexes.emplace_back(std::stoi(childs[childs.size()+childIndex]));
else
contextIndexes.emplace_back(-1);
{
candidate = std::stoi(childs[childs.size()+childIndex]);
if (candidate < baseIndex)
candidate = -1;
}
contextIndexes.emplace_back(candidate);
}
}
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment