ULAPI  8.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ULPartOfSpeech Class Reference

An object of type ULPartOfSpeech represents a single part of speech, including the base category (e.g. noun) and additional features (e.g. gender, case, number, etc.). More...

#include <ulpartofspeech.h>

Public Member Functions

 ULPartOfSpeech ()
 
 ULPartOfSpeech (const ULPartOfSpeech &other)
 
virtual ~ULPartOfSpeech ()
 
void clear ()
 
ULPartOfSpeechoperator= (const ULPartOfSpeech &other)
 
bool operator== (const ULPartOfSpeech &other) const
 
bool operator!= (const ULPartOfSpeech &other) const
 
bool operator< (const ULPartOfSpeech &other) const
 
uluint32 hash (uluint32 tableSize) const
 
ULNumber getNumber () const
 
ULGender getGender () const
 
ULPartOfSpeechSubcategory getPartOfSpeechSubcategory () const
 
ULCase getCase () const
 
ULTense getTense () const
 
ULPerson getPerson () const
 
ULFormality getFormality () const
 
ULMood getMood () const
 
ULAspect getAspect () const
 
ULTransitivity getTransitivity () const
 
bool isRootPartOfSpeech () const
 
const ULPartOfSpeechCategorygetPartOfSpeechCategory () const
 
void setPartOfSpeechCategory (const ULPartOfSpeechCategory &category)
 
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
 
ULString toString () const
 
const ULList< ULFeature > & getFeatureList () const
 

Protected Member Functions

bool findFeature (const ULFeatureType &featureType, int &featureValue) const
 

Protected Attributes

ULPartOfSpeechCategory partOfSpeechCategory
 
ULList< ULFeaturefeatureList
 

Detailed Description

An object of type ULPartOfSpeech represents a single part of speech, including the base category (e.g. noun) and additional features (e.g. gender, case, number, etc.).

Constructor & Destructor Documentation

ULPartOfSpeech::ULPartOfSpeech ( )

Default constructor.

ULPartOfSpeech::ULPartOfSpeech ( const ULPartOfSpeech other)

Copy constructor.

ULPartOfSpeech::~ULPartOfSpeech ( )
virtual

Destructor.

Member Function Documentation

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

Inserts the specified feature into this ULPartOfSpeech's 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 ULPartOfSpeech::addFeature ( const ULFeature feature)

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

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

Inserts the specified feature into this ULPartOfSpeech's 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 ULPartOfSpeech::clear ( )

Sets this ULPartOfSpeech object to its default state.

bool ULPartOfSpeech::findFeature ( const ULFeatureType featureType,
int &  featureValue 
) const
protected

Private method that supports several of the public methods (getCase, getGender, etc.).

Returns
true if this ULPartOfSpeech object has a feature of the specified type, false if not.
Parameters
[in]featureTypethe desired feature
[out]featureValuethe integer feature value
ULAspect ULPartOfSpeech::getAspect ( ) const
Returns
the ULAspect feature for this ULPartOfSpeech if one exists, or ULAspect::None if one does not.
ULCase ULPartOfSpeech::getCase ( ) const
Returns
the ULCase feature for this ULPartOfSpeech if one exists, or ULCase::None if one does not.
bool ULPartOfSpeech::getFeature ( const ULFeatureType featureType,
ULFeature feature 
) const

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

Returns
true if this ULPartOfSpeech has a feature with the specified type.
Parameters
[in]featureTypethe type of the desired feature.
[out]featurethe desired feature.
const ULList< ULFeature > & ULPartOfSpeech::getFeatureList ( ) const
Returns
a const reference to this ULPartOfSpeech's feature list.
ULFormality ULPartOfSpeech::getFormality ( ) const
Returns
the ULFormality feature for this ULPartOfSpeech if one exists, or ULFormality::None if one does not.
ULGender ULPartOfSpeech::getGender ( ) const
Returns
the ULGender feature for this ULPartOfSpeech if one exists, or ULGender::None if one does not.
ULMood ULPartOfSpeech::getMood ( ) const
Returns
the ULMood feature for this ULPartOfSpeech if one exists, or ULMood::None if one does not.
ULNumber ULPartOfSpeech::getNumber ( ) const
Returns
the ULNumber feature for this ULPartOfSpeech if one exists, or ULNumber::None if one does not.
const ULPartOfSpeechCategory & ULPartOfSpeech::getPartOfSpeechCategory ( ) const

Accessor.

ULPartOfSpeechSubcategory ULPartOfSpeech::getPartOfSpeechSubcategory ( ) const
Returns
the ULPartOfSpeechSubcategory feature for this ULPartOfSpeech if one exists, or ULPartOfSpeechSubcategory::None if one does not.
ULPerson ULPartOfSpeech::getPerson ( ) const
Returns
the ULPerson feature for this ULPartOfSpeech if one exists, or ULPerson::None if one does not.
ULTense ULPartOfSpeech::getTense ( ) const
Returns
the ULTense feature for this ULPartOfSpeech if one exists, or ULTense::None if one does not.
ULTransitivity ULPartOfSpeech::getTransitivity ( ) const
Returns
the ULTransitivity feature for this ULPartOfSpeech if one exists, or ULTransitivity::None if one does not.
bool ULPartOfSpeech::hasFeature ( const ULFeatureType featureType) const
Returns
true if this ULPartOfSpeech has a feature with the specified feature type.
uluint32 ULPartOfSpeech::hash ( uluint32  tableSize) const
bool ULPartOfSpeech::isRootPartOfSpeech ( ) const
Returns
true if this part of speech represents a root word (e.g. a verb infinitive, a noun singular, etc.)
bool ULPartOfSpeech::operator!= ( const ULPartOfSpeech other) const

Inequality operator.

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

Comparison operator. Parts of speech do not have a natural ordering, but sometimes we want to store them in sorted lists or hash tables, so comparison operators are convenient.

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

Assignment operator.

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

Equality operator.

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

If this ULPartOfSpeech's 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 ULPartOfSpeech::setPartOfSpeechCategory ( const ULPartOfSpeechCategory category)

Mutator.

ULString ULPartOfSpeech::toString ( ) const
Returns
a human-readable representation of this ULPartOfSpeech. TODO: include features

Member Data Documentation

ULList<ULFeature> ULPartOfSpeech::featureList
protected
ULPartOfSpeechCategory ULPartOfSpeech::partOfSpeechCategory
protected

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