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
......@@ -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));
......
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