omorfi 0.9.9
Open morphology of Finnish
Public Member Functions
omorfi::Omorfi Class Reference

#include <omorfi.hh>

Public Member Functions

 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)
 

Detailed Description

An object that can load and use omorfi language models.

Constructor & Destructor Documentation

◆ Omorfi()

omorfi::Omorfi::Omorfi ( )

Construct omorfi with no models loaded.

◆ ~Omorfi()

omorfi::Omorfi::~Omorfi ( )

Destroy omorfi and unload all models.

Member Function Documentation

◆ 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
tokena word to test
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
tokenword 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
filenamepath to an automaton file binary.

◆ tokenise()

std::vector< std::string > omorfi::Omorfi::tokenise ( const std::string &  text)

tokenise a string for analysis.

Parameters
texttext 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: