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

Parser entropy is only counted for a word being attached

parent 2a7eb155
No related branches found
No related tags found
No related merge requests found
......@@ -101,8 +101,19 @@ void Transition::apply(Config & config, float entropy)
{
if (config.hasColIndex("ENTROPY"))
{
auto action = Action::sumToHypothesis("ENTROPY", config.getWordIndex(), entropy);
action.apply(config, action);
if (name.find("SHIFT") == std::string::npos and name.find("REDUCE") == std::string::npos)
{
if (name.find("LEFT") != std::string::npos)
{
auto action = Action::sumToHypothesis("ENTROPY", config.getStack(0), entropy);
action.apply(config, action);
}
else
{
auto action = Action::sumToHypothesis("ENTROPY", config.getWordIndex(), entropy);
action.apply(config, action);
}
}
}
apply(config);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment