ULAPI  8.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
ULInflectionRule Class Reference

A ULInflectionRule object stores one of the rules stored in a ULLanguageDataSource and used by ULDissector and ULInflector to perform morphological analyses and syntheses. More...

#include <ulinflectionrule.h>

Public Member Functions

 ULInflectionRule ()
 
 ULInflectionRule (const ULInflectionRule &other)
 
 ~ULInflectionRule ()
 
ULInflectionRuleoperator= (const ULInflectionRule &other)
 
bool operator== (const ULInflectionRule &other) const
 
bool operator!= (const ULInflectionRule &other) const
 
void clear ()
 
uluint32 getGroup () const
 
void setGroup (uluint32 newGroup)
 
uluint32 getPriority () const
 
void setPriority (uluint32 newPriority)
 
bool isLookupRequired () const
 
void setLookupRequired (bool required)
 
bool isInitial () const
 
void setInitial (bool newIsInitial)
 
bool isTerminal () const
 
void setTerminal (bool newIsTerminal)
 
void addConstraint (const ULFeatureType &featureType, int value)
 
void addConstraint (const ULFeature &constraint)
 
void addStringConstraint (const ULFeatureType &featureType, const ULString &stringValue)
 
bool hasConstraint (const ULFeatureType &featureType) const
 
bool getFeature (const ULFeatureType &featureType, ULFeature &constraint) const
 
const ULList< ULFeature > & getConstraintList () const
 
const ULStringgetSourceAffix () const
 
void setSourceAffix (const ULString &newAffix)
 
const ULStringgetTargetAffix () const
 
void setTargetAffix (const ULString &newAffix)
 
const ULPartOfSpeechgetSourcePartOfSpeech () const
 
void setSourcePartOfSpeech (const ULPartOfSpeech &newPartOfSpeech)
 
const ULPartOfSpeechgetTargetPartOfSpeech () const
 
void setTargetPartOfSpeech (const ULPartOfSpeech &newPartOfSpeech)
 
const ULList< uluint32 > & getSuccessorOffsets () const
 
const ULList< uluint32 > & getPredecessorOffsets () const
 
bool isFullWordRule () const
 
bool constraintsMatchForInflection (const ULDerivation &derivation) const
 
bool affixesMatchForInflection (const ULDerivation &derivation) const
 
bool affixesMatchForDissection (const ULDerivation &derivation) const
 
bool partsOfSpeechMatchForDissection (const ULDerivation &derivation) const
 
bool partsOfSpeechMatchForInflection (const ULDerivation &derivation) const
 
bool applyForInflection (ULDerivation &derivation) const
 
bool applyForDissection (ULDerivation &derivation) const
 
ULString toString () const
 

Static Public Member Functions

static bool satisfies (const ULPartOfSpeech &posp, const ULPartOfSpeech &desiredPOSP)
 
static bool affixMatches (const ULString &affix, const ULString &s, const ULLanguage &language, bool ignoreCase=false, bool ignoreAccents=false)
 
static void removeAffix (const ULString &affix, ULString &s)
 
static bool applyAffix (const ULString &affix, const ULLanguage &language, ULString &s)
 

Friends

class ULCFileLanguageDataSource
 

Detailed Description

A ULInflectionRule object stores one of the rules stored in a ULLanguageDataSource and used by ULDissector and ULInflector to perform morphological analyses and syntheses.

Constructor & Destructor Documentation

ULInflectionRule::ULInflectionRule ( )

Default constructor.

ULInflectionRule::ULInflectionRule ( const ULInflectionRule other)

Copy constructor.

ULInflectionRule::~ULInflectionRule ( )

Destructor.

Member Function Documentation

void ULInflectionRule::addConstraint ( const ULFeatureType featureType,
int  value 
)

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

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

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

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

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

Parameters
[in]featureTypeThe type of the desired constraint.
[in]valueThe value to associate with the specified feature type.
bool ULInflectionRule::affixesMatchForDissection ( const ULDerivation derivation) const
bool ULInflectionRule::affixesMatchForInflection ( const ULDerivation derivation) const
bool ULInflectionRule::affixMatches ( const ULString affix,
const ULString s,
const ULLanguage language,
bool  ignoreCase = false,
bool  ignoreAccents = false 
)
static
bool ULInflectionRule::applyAffix ( const ULString affix,
const ULLanguage language,
ULString s 
)
static
bool ULInflectionRule::applyForDissection ( ULDerivation derivation) const

If this rule can be applied to the front of the given derivation, modifying the root, root part of speech, and inflection rule list accordingly, then this method does so. Otherwise, it leaves the derivation unchanged. For example, suppose we have a derivation whose root is "baker" and whose derived form is "bakers". Consider the rule that takes a verb ending in "-e" and transforms it into a noun (representing a person who performs the verb) by replacing the "-e" with "-er". Then this rule can be applied to the "baker -> bakers" derivation to give us the derivation "bake -> baker -> bakers".

Returns
true if this rule has been applied to the derivation, false otherwise.
Parameters
[in,out]derivationthe derivation to be modified.
bool ULInflectionRule::applyForInflection ( ULDerivation derivation) const

If this rule can be applied to the end of the given derivation, modifying the derivation's inflection rule list accordingly, then this method does so. Otherwise, it leaves the derivation unchanged. For example, suppose we have a derivation whose root is "bake" and whose derived form is "baker". Consider the rule that takes a singular noun and and transforms it into a plural noun by appending "-s". Then this rule can be applied to the "bake -> baker" derivation to give us the new derivation "bake -> baker -> bakers".

Returns
true if this rule has been applied to the derivation, false if the extension of the derivation was unsuccessful.
Parameters
[in,out]derivationthe derivation to be modified.
void ULInflectionRule::clear ( )

Sets this rule to its default state.

bool ULInflectionRule::constraintsMatchForInflection ( const ULDerivation derivation) const
const ULList< ULFeature > & ULInflectionRule::getConstraintList ( ) const
Returns
a reference to this rule's constraint list.
bool ULInflectionRule::getFeature ( const ULFeatureType featureType,
ULFeature constraint 
) const

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

Returns
true if this ULInflectionRule has a feature with the specified feature type.
Parameters
[in]featureTypethe type of the desired constraint.
[out]constraintthe desired constraint.
uluint32 ULInflectionRule::getGroup ( ) const

Accessor.

const ULList< uluint32 > & ULInflectionRule::getPredecessorOffsets ( ) const

Accessor.

uluint32 ULInflectionRule::getPriority ( ) const

Accessor.

const ULString & ULInflectionRule::getSourceAffix ( ) const

Accessor.

const ULPartOfSpeech & ULInflectionRule::getSourcePartOfSpeech ( ) const

Accessor.

const ULList< uluint32 > & ULInflectionRule::getSuccessorOffsets ( ) const

Accessor.

const ULString & ULInflectionRule::getTargetAffix ( ) const

Accessor.

const ULPartOfSpeech & ULInflectionRule::getTargetPartOfSpeech ( ) const

Accessor.

bool ULInflectionRule::hasConstraint ( const ULFeatureType featureType) const
Returns
true if this ULInflectionRule has a feature with the specified feature type.
bool ULInflectionRule::isFullWordRule ( ) const
Returns
true if this rule transforms a complete word to a different complete word. For example, a rule might transform the infinitive "think" to the irregular past tense "thought".
bool ULInflectionRule::isInitial ( ) const

Accessor.

bool ULInflectionRule::isLookupRequired ( ) const

Accessor.

bool ULInflectionRule::isTerminal ( ) const

Accessor.

bool ULInflectionRule::operator!= ( const ULInflectionRule other) const

Inequality operator.

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

Assignment operator.

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

Equality operator.

bool ULInflectionRule::partsOfSpeechMatchForDissection ( const ULDerivation derivation) const
bool ULInflectionRule::partsOfSpeechMatchForInflection ( const ULDerivation derivation) const
void ULInflectionRule::removeAffix ( const ULString affix,
ULString s 
)
static
bool ULInflectionRule::satisfies ( const ULPartOfSpeech posp,
const ULPartOfSpeech desiredPOSP 
)
static
void ULInflectionRule::setGroup ( uluint32  newGroup)

Mutator.

void ULInflectionRule::setInitial ( bool  newIsInitial)

Mutator.

void ULInflectionRule::setLookupRequired ( bool  required)

Mutator.

void ULInflectionRule::setPriority ( uluint32  newPriority)

Mutator.

void ULInflectionRule::setSourceAffix ( const ULString newAffix)

Mutator.

void ULInflectionRule::setSourcePartOfSpeech ( const ULPartOfSpeech newPartOfSpeech)

Mutator.

void ULInflectionRule::setTargetAffix ( const ULString newAffix)

Mutator.

void ULInflectionRule::setTargetPartOfSpeech ( const ULPartOfSpeech newPartOfSpeech)

Mutator.

void ULInflectionRule::setTerminal ( bool  newIsTerminal)

Mutator.

ULString ULInflectionRule::toString ( ) const

Friends And Related Function Documentation

friend class ULCFileLanguageDataSource
friend

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