ULAPI  8.0
Public Types | Public Member Functions | List of all members
ULDerivation Class Reference

A ULDerivation object stores a complete morphological derivation of a word. For example, the derivation of the word "bakers" would consist of the word "bake [verb]" plus two inflection rules, one that transforms a verb into a noun by adding an "-er" suffix, and the other that transforms a singular noun into a plural noun. More...

#include <ulderivation.h>

Public Types

enum  { Speculative, Verified, Invalid }
 

Public Member Functions

 ULDerivation ()
 
 ULDerivation (const ULDerivation &other)
 
 ~ULDerivation ()
 
ULDerivationoperator= (const ULDerivation &other)
 
bool operator== (const ULDerivation &other) const
 
bool operator< (const ULDerivation &other) const
 
bool operator!= (const ULDerivation &other) const
 
void clear ()
 
bool initializeFromWordAndRules (const ULLanguage &language, const ULDerivation &word, const ULList< ULInflectionRule > &ruleList)
 
ULLanguage getLanguage () const
 
void setLanguage (const ULLanguage &newLanguage)
 
int getValidity () const
 
void setValidity (int newValidity)
 
uluint32 getClassID () const
 
void setClassID (uluint32 classID)
 
const ULStringgetRoot () const
 
void setRoot (const ULString &newRoot)
 
const ULPartOfSpeechgetRootPartOfSpeech () const
 
void setRootPartOfSpeech (const ULPartOfSpeech &newPartOfSpeech)
 
const ULDictionaryIteratorgetRootDictionaryIterator () const
 
void setRootDictionaryIterator (const ULDictionaryIterator &dictionaryIterator)
 
void addFeature (const ULFeatureType &featureType, int value)
 
void addFeature (const ULFeature &feature)
 
void addStringFeature (const ULFeatureType &featureType, const ULString &stringValue)
 
void setFeature (const ULFeatureType &featureType, int value)
 
bool hasFeature (const ULFeatureType &featureType) const
 
bool getFeature (const ULFeatureType &featureType, ULFeature &feature) const
 
const ULList< ULFeature > & getRootFeatureList () const
 
void clearRootFeatureList ()
 
const ULStringgetDerivedForm () const
 
void setDerivedForm (const ULString &newDerivedForm)
 
const ULPartOfSpeechgetDerivedFormPartOfSpeech () const
 
void setDerivedFormPartOfSpeech (const ULPartOfSpeech &newPartOfSpeech)
 
void appendInflectionRule (const ULInflectionRule &rule)
 
void removeFrontRule ()
 
void removeBackRule ()
 
void prependInflectionRule (const ULInflectionRule &rule)
 
const ULList< ULInflectionRule > & getInflectionRuleList () const
 
bool finish (const ULString &originalSearchString, ULDissector *dissector, ULInflector *inflector)
 
bool isReverseExtendable () const
 
ULString toString (bool verbose=false, bool showOnlyEndpoints=false) const
 

Detailed Description

A ULDerivation object stores a complete morphological derivation of a word. For example, the derivation of the word "bakers" would consist of the word "bake [verb]" plus two inflection rules, one that transforms a verb into a noun by adding an "-er" suffix, and the other that transforms a singular noun into a plural noun.

Member Enumeration Documentation

anonymous enum
Enumerator:
Speculative 
Verified 
Invalid 

Constructor & Destructor Documentation

ULDerivation::ULDerivation ( )

Default constructor.

ULDerivation::ULDerivation ( const ULDerivation other)

Copy constructor.

ULDerivation::~ULDerivation ( )

Destructor.

Member Function Documentation

void ULDerivation::addFeature ( const ULFeatureType featureType,
int  featureValue 
)

Inserts the specified integer-valued feature into this derivation's root feature list. If an identical feature already exists, this method does nothing.

Parameters
[in]featureTypeThe type of the desired feature.
[in]valueThe value to associate with the specified feature type.
void ULDerivation::addFeature ( const ULFeature feature)

Inserts the specified feature into this derivation's root feature list. If an identical feature already exists, this method does nothing.

Parameters
[in]featurethe desired feature.
void ULDerivation::addStringFeature ( const ULFeatureType featureType,
const ULString stringValue 
)

Inserts the specified feature into this derivation's root feature list. If an identical feature already exists, this method does nothing.

Parameters
[in]featureTypeThe type of the desired feature.
[in]valueThe value to associate with the specified feature type.
void ULDerivation::appendInflectionRule ( const ULInflectionRule rule)

Add the specified inflection rule to the end of this derivation's list of rules.

void ULDerivation::clear ( )

Sets this rule to its default state.

void ULDerivation::clearRootFeatureList ( )

Clears this derivation's root feature list.

bool ULDerivation::finish ( const ULString originalSearchString,
ULDissector dissector,
ULInflector inflector 
)

Used by ULInflector and ULDissector to perform some final adjustments to make this derivation valid. Users of ULAPI should not call this method.

uluint32 ULDerivation::getClassID ( ) const

Accessor.

const ULString & ULDerivation::getDerivedForm ( ) const

Accessor.

const ULPartOfSpeech & ULDerivation::getDerivedFormPartOfSpeech ( ) const

Accessor.

bool ULDerivation::getFeature ( const ULFeatureType featureType,
ULFeature feature 
) const

Gets the feature associated with the specified feature type, if any such value exists in this derivation's root feature list.

Returns
true if this derivation has a feature with the specified feature type.
Parameters
[in]featureTypethe type of the desired feature.
[out]featurethe desired feature.
const ULList< ULInflectionRule > & ULDerivation::getInflectionRuleList ( ) const
Returns
a reference to this derivation's list of inflection rules.
ULLanguage ULDerivation::getLanguage ( ) const

Accessor.

const ULString & ULDerivation::getRoot ( ) const

Accessor.

const ULDictionaryIterator & ULDerivation::getRootDictionaryIterator ( ) const

Accessor.

const ULList< ULFeature > & ULDerivation::getRootFeatureList ( ) const
Returns
a const reference to this derivation's root feature list, in case the caller wishes, for example, to traverse the entire list instead of using hasFeature or getFeature.
const ULPartOfSpeech & ULDerivation::getRootPartOfSpeech ( ) const

Accessor.

int ULDerivation::getValidity ( ) const

Accessor.

bool ULDerivation::hasFeature ( const ULFeatureType featureType) const
Returns
true if this derivation has a feature with the specified feature type.
bool ULDerivation::initializeFromWordAndRules ( const ULLanguage language,
const ULDerivation word,
const ULList< ULInflectionRule > &  ruleList 
)

Builds this derivation by starting from the specified word and applying the specified rules in sequence.

Returns
true if the sequence of inflection rules can be applied successfully (i.e. ULInfelctionRule::applyForInflection returns true for each rule in ruleList). If any rule application fails, this derivation is cleared and initializeFromWordAndRules returns false.
Parameters
[in]languagethe derivation's language
[in]wordthe word from which to initialize this derivation.
[in]ruleListthe inflection rules to apply to form this derivation.
bool ULDerivation::isReverseExtendable ( ) const
bool ULDerivation::operator!= ( const ULDerivation other) const

Inequality operator.

bool ULDerivation::operator< ( const ULDerivation other) const

Comparison operator, only so ULList<ULDerivation> will compile in SWIG. Do not try to use this operator for anything sensible. It always returns false.

ULDerivation & ULDerivation::operator= ( const ULDerivation other)

Assignment operator.

bool ULDerivation::operator== ( const ULDerivation other) const

Equality operator.

void ULDerivation::prependInflectionRule ( const ULInflectionRule rule)

Add the specified inflection rule to the beginning of this derivation's list of rules.

void ULDerivation::removeBackRule ( )

Remove the inflection rule from the end of the inflection rule list (i.e. at the end that results in the current derived form).

void ULDerivation::removeFrontRule ( )

Remove the inflection rule from the front of the inflection rule list.

void ULDerivation::setClassID ( uluint32  classID)

Mutator.

void ULDerivation::setDerivedForm ( const ULString newDerivedForm)

Mutator.

void ULDerivation::setDerivedFormPartOfSpeech ( const ULPartOfSpeech newPartOfSpeech)

Mutator.

void ULDerivation::setFeature ( const ULFeatureType featureType,
int  value 
)

If this derivation's root feature list already has a feature with the specified ID, change that feature's value to the specified value. Otherwise, add a new feature to the list. If more than one feature with the specified ID already exists, change the value for all of the matching features.

Parameters
[in]featureTypethe type of the desired feature.
[in]valuethe integer value to associate with the specified feature type.
void ULDerivation::setLanguage ( const ULLanguage newLanguage)

Mutator.

void ULDerivation::setRoot ( const ULString newRoot)

Mutator.

void ULDerivation::setRootDictionaryIterator ( const ULDictionaryIterator dictionaryIterator)

Mutator.

void ULDerivation::setRootPartOfSpeech ( const ULPartOfSpeech newPartOfSpeech)

Mutator.

void ULDerivation::setValidity ( int  newValidity)

Mutator.

ULString ULDerivation::toString ( bool  verbose = false,
bool  showOnlyEndpoints = false 
) const
Returns
a human-readable representation of the derivation. It won't contain all of the internal structure of the derivation,

The documentation for this class was generated from the following files: