Commit d536a34e authored by Franck Dary's avatar Franck Dary
Browse files

Added special columns STACK_SIZE et STACK_DIST

parent 72d8d396
......@@ -99,6 +99,23 @@ Transition::Transition(const std::string & name)
void Transition::apply(Config & config, float entropy)
{
if (config.hasColIndex("STACK_SIZE"))
{
auto & curValue = config.get("STACK_SIZE", config.getWordIndex(), 0);
if (curValue.get().empty())
curValue = fmt::format("{}", config.getStackSize());
}
if (config.hasColIndex("STACK_DIST"))
{
auto & curValue = config.get("STACK_DIST", config.getWordIndex(), 0);
if (curValue.get().empty())
{
if (config.hasStack(0) and config.hasStack(1))
curValue = fmt::format("{}", config.getStack(0) - config.getStack(1));
else
curValue = fmt::format("_");
}
}
if (config.hasColIndex("ENTROPY"))
{
bool mean = true;
......
Markdown is supported
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