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

Only update stack_dist and stack_size when on state parser

parent 4818cfc8
No related branches found
No related tags found
No related merge requests found
......@@ -101,14 +101,14 @@ void Transition::apply(Config & config, float entropy)
{
if (config.hasColIndex("STACK_SIZE"))
{
auto & curValue = config.get("STACK_SIZE", config.getWordIndex(), 0);
if (std::string(curValue).empty())
auto & curValue = config.getLastNotEmptyHyp("STACK_SIZE", config.getWordIndex());
if (std::string(curValue).empty() and config.getState() == "parser")
curValue = fmt::format("{}", config.getStackSize());
}
if (config.hasColIndex("STACK_DIST"))
{
auto & curValue = config.get("STACK_DIST", config.getWordIndex(), 0);
if (std::string(curValue).empty())
auto & curValue = config.getLastNotEmptyHyp("STACK_DIST", config.getWordIndex());
if (std::string(curValue).empty() and config.getState() == "parser")
{
if (config.hasStack(0) and config.hasStack(1))
curValue = fmt::format("{}", config.getStack(0) - config.getStack(1));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment