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

Fixed attaching floating words in sentence when EOS is ref and predicted

parent ee8547e6
No related branches found
No related tags found
No related merge requests found
......@@ -769,10 +769,10 @@ std::vector<Action::BasicAction> ActionBank::str2sequence(const std::string & na
// Attaching floating words to new root
int sentenceEnd = b0;
auto & eos = c.getTape(ProgramParameters::sequenceDelimiterTape);
while (sentenceEnd >= 0 && eos[sentenceEnd-b0] != ProgramParameters::sequenceDelimiter)
while (sentenceEnd >= 0 && eos.getHyp(sentenceEnd-b0) != ProgramParameters::sequenceDelimiter)
sentenceEnd--;
int sentenceStart = std::max(0,sentenceEnd-1);
while (sentenceStart >= 0 && eos[sentenceStart-b0] != ProgramParameters::sequenceDelimiter)
while (sentenceStart >= 0 && eos.getHyp(sentenceStart-b0) != ProgramParameters::sequenceDelimiter)
sentenceStart--;
sentenceStart++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment