Skip to content
Snippets Groups Projects
Commit c34cbafb authored by Franck Dary's avatar Franck Dary
Browse files

EOS now delete arcs cross sentences

parent 1d0db720
Branches
No related tags found
No related merge requests found
...@@ -205,6 +205,7 @@ Action Action::setRoot() ...@@ -205,6 +205,7 @@ Action Action::setRoot()
auto apply = [](Config & config, Action & a) auto apply = [](Config & config, Action & a)
{ {
int rootIndex = -1; int rootIndex = -1;
int firstSentenceIndex = -1;
for (int i = config.getStack(0); true; --i) for (int i = config.getStack(0); true; --i)
{ {
...@@ -220,6 +221,8 @@ Action Action::setRoot() ...@@ -220,6 +221,8 @@ Action Action::setRoot()
if (config.getLastNotEmptyHypConst(Config::EOSColName, i) == Config::EOSSymbol1) if (config.getLastNotEmptyHypConst(Config::EOSColName, i) == Config::EOSSymbol1)
break; break;
firstSentenceIndex = i;
if (util::isEmpty(config.getLastNotEmptyHypConst(Config::headColName, i))) if (util::isEmpty(config.getLastNotEmptyHypConst(Config::headColName, i)))
{ {
rootIndex = i; rootIndex = i;
...@@ -253,6 +256,11 @@ Action Action::setRoot() ...@@ -253,6 +256,11 @@ Action Action::setRoot()
config.getFirstEmpty(Config::headColName, i) = std::to_string(rootIndex); config.getFirstEmpty(Config::headColName, i) = std::to_string(rootIndex);
} }
} }
else
{
if (std::stoi(config.getLastNotEmptyHypConst(Config::headColName, i)) < firstSentenceIndex)
config.getFirstEmpty(Config::headColName, i) = std::to_string(rootIndex);
}
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment