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

Added a tokenizer oracle

parent bdc9e448
No related branches found
No related tags found
No related merge requests found
...@@ -92,6 +92,22 @@ void Oracle::createDatabase() ...@@ -92,6 +92,22 @@ void Oracle::createDatabase()
return action == "WRITE b.0 POS " + c.getTape("POS").ref[c.head] || c.head >= (int)c.tapes[0].ref.size()-1; return action == "WRITE b.0 POS " + c.getTape("POS").ref[c.head] || c.head >= (int)c.tapes[0].ref.size()-1;
}))); })));
str2oracle.emplace("tokenizer", std::unique_ptr<Oracle>(new Oracle(
[](Oracle *)
{
},
[](Config &, Oracle *)
{
fprintf(stderr, "ERROR (%s) : getAction called on Oracle of trainable Classifier. Aborting.\n", ERRINFO);
exit(1);
return std::string("");
},
[](Config & c, Oracle *, const std::string & action)
{
return action == "WRITE b.0 BIO " + c.getTape("BIO").ref[c.head] || c.head >= (int)c.tapes[0].ref.size()-1;
})));
str2oracle.emplace("eos", std::unique_ptr<Oracle>(new Oracle( str2oracle.emplace("eos", std::unique_ptr<Oracle>(new Oracle(
[](Oracle *) [](Oracle *)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment