#include <omorfi.hh>
|
| Omorfi () |
|
| ~Omorfi () |
|
void | loadAnalyser (const std::string &filename) |
|
std::vector< std::string > | analyse (const std::string &token) |
|
std::vector< std::string > | tokenise (const std::string &text) |
|
bool | accept (const std::string &token) |
|
An object that can load and use omorfi language models.
◆ Omorfi()
omorfi::Omorfi::Omorfi |
( |
| ) |
|
Construct omorfi with no models loaded.
◆ ~Omorfi()
omorfi::Omorfi::~Omorfi |
( |
| ) |
|
Destroy omorfi and unload all models.
◆ accept()
bool omorfi::Omorfi::accept |
( |
const std::string & |
token | ) |
|
Test if string is a valid word-form and in the lexicon. Note that this function is not any faster than analyse
, but it resolves some internal codings of guessed analyses.
- Parameters
-
- Returns
- true if token is in dictionary, false otherwise
◆ analyse()
std::vector< std::string > omorfi::Omorfi::analyse |
( |
const std::string & |
token | ) |
|
analyse a string as a single input token.
- Parameters
-
token | word to analys as string |
- Returns
- an unordered vector of strings giving all known analyses. May be an empty list if no analyses are found, but this behaviour cannot be trusted upon: many models will back-off giving at least one analysis for any given input.
◆ loadAnalyser()
void omorfi::Omorfi::loadAnalyser |
( |
const std::string & |
filename | ) |
|
load analysis model from a file.
- Parameters
-
filename | path to an automaton file binary. |
◆ tokenise()
std::vector< std::string > omorfi::Omorfi::tokenise |
( |
const std::string & |
text | ) |
|
tokenise a string for analysis.
- Parameters
-
text | text to split into tokens. |
- Returns
- a vector of tokens given as strings, in order they should appear in the analyses. The return value does not need to be a split of source
text
.
The documentation for this class was generated from the following file:
- /home/flammie/github/flammie/omorfi/src/cpp/omorfi.hh