|
| GrammarTask (ucam::util::RegistryPO const &rg, std::string const &featureweightskey=HifstConstants::kGrammarFeatureweights, unsigned featureoffset=0) |
| Constructor. More...
|
|
| GrammarTask (const std::string &grammarfilekey=HifstConstants::kGrammarLoad, const std::string &patternfilekey=HifstConstants::kGrammarStorepatterns) |
| Constructor used for unit testing. More...
|
|
GrammarData * | getGrammarData () |
| Returns GrammarData. More...
|
|
bool | run (Data &d) |
| ucam::util::TaskInterface mandatory method implementation. This method loads the hierarchical grammar, stores patterns, finds non-terminal hierarchy and delivers pointer to data object, for other tasks to use the grammar More...
|
|
void | load (const std::string &file) |
| Loads rules from a grammar file. More...
|
|
void | load (std::stringstream &s) |
| Loads rules from a stringstream. More...
|
|
virtual | ~GrammarTask () |
|
| TaskInterface () |
| Constructor. More...
|
|
virtual | ~TaskInterface () |
|
bool | chainrun (Data &d) |
| Implements chain of responsability. Calls run method and, if there is another task, call its run method too. More...
|
|
bool | operator() (Data &d) |
|
TaskInterface & | appendTask (TaskInterface *t) |
| Appends a task class. If there is no task, append here, otherwise delegate in next task. More...
|
|
TaskInterface & | operator() (TaskInterface *t) |
|
TaskInterface * | getTask () |
| Return appended task. More...
|
|
TaskInterface * | next () |
|
template<class Data>
class ucam::hifst::GrammarTask< Data >
Task class that loads a grammar into memory.
It provides methods to take as input a [file], and read the contents, sort and populate GrammarData. Optionally it can also store grammar-specific patterns.
Definition at line 38 of file task.grammar.hpp.