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

Removed signature

parent dd1c5a40
No related branches found
No related tags found
No related merge requests found
...@@ -360,18 +360,16 @@ void Oracle::createDatabase() ...@@ -360,18 +360,16 @@ void Oracle::createDatabase()
[](Config & c, Oracle *) [](Config & c, Oracle *)
{ {
if (c.pastActions.size() == 0) if (c.pastActions.size() == 0)
return std::string("MOVE signature 0"); return std::string("MOVE tagger 0");
std::string previousState = util::noAccentLower(c.pastActions.getElem(0).first); std::string previousState = util::noAccentLower(c.pastActions.getElem(0).first);
std::string previousAction = util::noAccentLower(c.pastActions.getElem(0).second.name); std::string previousAction = util::noAccentLower(c.pastActions.getElem(0).second.name);
std::string newState; std::string newState;
int movement = 0; int movement = 0;
if (previousState == "signature") if (previousState == "tagger" || previousState == "error_tagger")
newState = "tagger";
else if (previousState == "tagger" || previousState == "error_tagger")
{ {
newState = "signature"; newState = "tagger";
movement = 1; movement = 1;
} }
...@@ -432,27 +430,17 @@ void Oracle::createDatabase() ...@@ -432,27 +430,17 @@ void Oracle::createDatabase()
std::string previousState = util::noAccentLower(c.pastActions.getElem(0).first); std::string previousState = util::noAccentLower(c.pastActions.getElem(0).first);
std::string previousAction = util::noAccentLower(c.pastActions.getElem(0).second.name); std::string previousAction = util::noAccentLower(c.pastActions.getElem(0).second.name);
std::string newState; std::string newState = "tokenizer";
int movement = 0; int movement = 0;
if (previousState == "signature") if (util::split(previousAction, ' ')[0] == "splitword")
{ {
newState = "tokenizer"; int nbSplit = util::split(util::split(previousAction, ' ')[1], '@').size();
movement = 1; movement = nbSplit;
} }
else if (previousState == "tokenizer") else if (previousAction == "endword")
{ movement = 1;
if (util::split(previousAction, ' ')[0] == "splitword" || util::split(previousAction, ' ')[0] == "endword")
newState = "signature";
else
newState = "tokenizer";
if (util::split(previousAction, ' ')[0] == "splitword")
{
int nbSplit = util::split(util::split(previousAction, ' ')[1], '@').size();
movement = nbSplit-1;
}
}
return "MOVE " + newState + " " + std::to_string(movement); return "MOVE " + newState + " " + std::to_string(movement);
}, },
[](Config &, Oracle *, const std::string &) [](Config &, Oracle *, const std::string &)
...@@ -474,12 +462,10 @@ void Oracle::createDatabase() ...@@ -474,12 +462,10 @@ void Oracle::createDatabase()
std::string newState; std::string newState;
int movement = 0; int movement = 0;
if (previousState == "signature") if (previousState == "tokenizer")
newState = "tagger";
else if (previousState == "tokenizer")
{ {
if (util::split(previousAction, ' ')[0] == "splitword" || util::split(previousAction, ' ')[0] == "endword") if (util::split(previousAction, ' ')[0] == "splitword" || util::split(previousAction, ' ')[0] == "endword")
newState = "signature"; newState = "tagger";
else else
newState = "tokenizer"; newState = "tokenizer";
...@@ -506,23 +492,18 @@ void Oracle::createDatabase() ...@@ -506,23 +492,18 @@ void Oracle::createDatabase()
[](Config & c, Oracle *) [](Config & c, Oracle *)
{ {
if (c.pastActions.size() == 0) if (c.pastActions.size() == 0)
return std::string("MOVE signature 0"); return std::string("MOVE parser 0");
std::string previousState = util::noAccentLower(c.pastActions.getElem(0).first); std::string previousState = util::noAccentLower(c.pastActions.getElem(0).first);
std::string previousAction = util::noAccentLower(c.pastActions.getElem(0).second.name); std::string previousAction = util::noAccentLower(c.pastActions.getElem(0).second.name);
std::string newState; std::string newState;
int movement = 0; int movement = 0;
if (previousState == "signature") if (previousState == "parser")
newState = "parser";
else if (previousState == "parser")
{ {
newState = "parser"; newState = "parser";
if (util::split(previousAction, ' ')[0] == "shift" || util::split(previousAction, ' ')[0] == "right") if (util::split(previousAction, ' ')[0] == "shift" || util::split(previousAction, ' ')[0] == "right")
{
movement = 1; movement = 1;
newState = "signature";
}
if (movement > 0 && c.endOfTapes()) if (movement > 0 && c.endOfTapes())
movement = 0; movement = 0;
...@@ -535,10 +516,7 @@ void Oracle::createDatabase() ...@@ -535,10 +516,7 @@ void Oracle::createDatabase()
newState = "parser"; newState = "parser";
std::string previousParserAction = util::noAccentLower(c.pastActions.getElem(1).second.name); std::string previousParserAction = util::noAccentLower(c.pastActions.getElem(1).second.name);
if (util::split(previousParserAction, ' ')[0] == "shift" || util::split(previousParserAction, ' ')[0] == "right") if (util::split(previousParserAction, ' ')[0] == "shift" || util::split(previousParserAction, ' ')[0] == "right")
{
newState = "signature";
movement = 1; movement = 1;
}
} }
return "MOVE " + newState + " " + std::to_string(movement); return "MOVE " + newState + " " + std::to_string(movement);
...@@ -555,16 +533,14 @@ void Oracle::createDatabase() ...@@ -555,16 +533,14 @@ void Oracle::createDatabase()
[](Config & c, Oracle *) [](Config & c, Oracle *)
{ {
if (c.pastActions.size() == 0) if (c.pastActions.size() == 0)
return std::string("MOVE signature 0"); return std::string("MOVE tagger 0");
std::string previousState = util::noAccentLower(c.pastActions.getElem(0).first); std::string previousState = util::noAccentLower(c.pastActions.getElem(0).first);
std::string previousAction = util::noAccentLower(c.pastActions.getElem(0).second.name); std::string previousAction = util::noAccentLower(c.pastActions.getElem(0).second.name);
std::string newState; std::string newState;
int movement = 0; int movement = 0;
if (previousState == "signature") if (previousState == "tagger")
newState = "tagger";
else if (previousState == "tagger")
newState = "morpho"; newState = "morpho";
else if (previousState == "morpho") else if (previousState == "morpho")
newState = "lemmatizer_lookup"; newState = "lemmatizer_lookup";
...@@ -583,7 +559,7 @@ void Oracle::createDatabase() ...@@ -583,7 +559,7 @@ void Oracle::createDatabase()
{ {
if (util::split(previousAction, ' ')[0] == "shift" || util::split(previousAction, ' ')[0] == "right") if (util::split(previousAction, ' ')[0] == "shift" || util::split(previousAction, ' ')[0] == "right")
{ {
newState = "signature"; newState = "tagger";
if (c.endOfTapes()) if (c.endOfTapes())
newState = "parser"; newState = "parser";
movement = 1; movement = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment