ULAPI
8.0
|
A ULInflector is a low-level worker that takes morphological information and constructs a word (or words) from it. For example, (bus, noun, plural) gets inflected into the pair of alternative spellings [buses, busses]. More...
#include <ulinflector.h>
Static Public Member Functions | |
static ULInflector * | createInflector (const ULLanguage &language) |
Protected Member Functions | |
ULError | inflectWithWord (const ULString &originalSearchString, const ULDerivation &word, const ULPartOfSpeech &targetPartOfSpeech, uluint32 maxDerivationLength, ULList< ULDerivation > &derivationList) |
void | getInflections (const ULString &originalSearchString, ULDerivation &derivation, const ULPartOfSpeech &targetPartOfSpeech, uluint32 maxDerivationLength, ULList< ULDerivation > &derivationList) |
bool | isWordWithPartOfSpeech (const ULString &s, const ULPartOfSpeech &targetPartOfSpeech) |
void | getMatchingTerms (const ULString &s, ULList< ULPartOfSpeech > &pospList, ULList< ULDictionaryIterator > &iteratorList) |
Static Protected Member Functions | |
static void | filterRulesForInflection (const ULPartOfSpeech &targetPartOfSpeech, ULList< ULInflectionRule > &ruleList) |
Protected Attributes | |
ULLanguageDataSource * | languageDataSource |
ULDictionaryDataSource * | dictionaryDataSource |
Friends | |
class | ULDerivation |
A ULInflector is a low-level worker that takes morphological information and constructs a word (or words) from it. For example, (bus, noun, plural) gets inflected into the pair of alternative spellings [buses, busses].
ULInflector::ULInflector | ( | ) |
Default constructor.
ULInflector::ULInflector | ( | const ULInflector & | other | ) |
Copy constructor.
|
virtual |
Destructor.
void ULInflector::clear | ( | ) |
Sets this inflector to its default values.
|
static |
Static method that instantiates and initializes an object of the subclass appropriate for the specified language.
|
staticprotected |
Private method that chooses among a set of inflection rules that could be chosen as the first rule in a derivation heading towards the specified target part of speech.
|
virtual |
ULDictionaryDataSource * ULInflector::getDictionaryDataSource | ( | ) |
|
protected |
Private method called by inflect that recursively evaluates possible derivations leading to the desired part of speech.
[in] | derivation | the derivation to build upon. |
[in] | targetPartOfSpeech | the part of speech we're trying to build towards. |
[in] | maxDerivationLength | the longest rule sequence we're willing to allow in a derivation. A value of 0 means any length is acceptable |
[out] | derivationList | the list of accepted derivations. This list starts out empty at the initial call of getInflections, but builds up as the recursion proceeds. |
const ULLanguage & ULInflector::getLanguage | ( | ) | const |
ULLanguageDataSource * ULInflector::getLanguageDataSource | ( | ) |
|
protected |
|
virtual |
Computes all inflections (i.e. morphological derivations) for the specified word, starting with the assumption that the word has the given (source) part of speech, and that the inflected form has the given target part of speech.
[in] | word | the word to inflect |
[in] | sourcePartOfSpeech | the part of speech of the original word |
[in] | targetPartOfSpeech | the desired part of speech of the inflected form |
[in] | maxDerivationLength | if greater than 0, the maximum number of inflection rules allowed in a derivation. If zero, any length of derivation is allowed. |
[out] | derivationList | the desired derivations |
|
virtual |
Computes all inflections (i.e. morphological derivations) for the specified verb, resulting in the inflected (conjugated) form or forms with the given target part of speech.
[in] | verb | the verb to inflect |
[in] | targetPartOfSpeech | the desired part of speech of the inflected form |
[in] | maxDerivationLength | if greater than 0, the maximum number of inflection rules allowed in a derivation. If zero, any length of derivation is allowed. |
[out] | derivationList | the desired derivations |
|
protected |
|
virtual |
|
protected |
ULInflector & ULInflector::operator= | ( | const ULInflector & | other | ) |
Assignment operator.
void ULInflector::setDictionaryDataSource | ( | ULDictionaryDataSource * | dataSource | ) |
Assigns the dictionary data source to be used by this inflector. The ULInflector does not take responsibility for deleting the data source. That will need to happen elsewhere (typically the ULFactory will take care of it if your application uses ULFactory to instantiate data sources and workers).
[in] | dataSource | A pointer to the desired dictionary data source. |
void ULInflector::setLanguageDataSource | ( | ULLanguageDataSource * | dataSource | ) |
Set the language data source used by this ULInflector to perform inflections. The ULInflector does not take responsibility for deleting the data source. That will need to happen elsewhere (typically the ULFactory will take care of it if your application uses ULFactory to instantiate data sources and workers).
[in] | dataSource | The desired language data source. |
|
friend |
|
protected |
|
protected |