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

An object of type ULExample represents a single example. More...

#include <ulexample.h>

Public Member Functions

 ULExample ()
 
 ULExample (const ULExample &other)
 
virtual ~ULExample ()
 
void clear ()
 
ULExampleoperator= (const ULExample &other)
 
bool operator== (const ULExample &other) const
 
bool operator!= (const ULExample &other) const
 
ULString getText () const
 
ULString getTranslation () const
 
void addFeature (const ULFeatureType &featureType, ULString value)
 
void addFeature (const ULFeature &feature)
 
void setFeature (const ULFeatureType &featureType, ULString 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, ULString &featureValue) const
 

Protected Attributes

ULList< ULFeaturefeatureList
 

Detailed Description

An object of type ULExample represents a single example.

Constructor & Destructor Documentation

ULExample::ULExample ( )

Default constructor.

ULExample::ULExample ( const ULExample other)

Copy constructor.

ULExample::~ULExample ( )
virtual

Destructor.

Member Function Documentation

void ULExample::addFeature ( const ULFeatureType featureType,
ULString  featureValue 
)

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

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

Parameters
[in]featurethe feature.
void ULExample::clear ( )

Sets this ULPartOfSpeech object to its default state.

bool ULExample::findFeature ( const ULFeatureType featureType,
ULString featureValue 
) const
protected

Private method that supports several of the public methods.

Returns
true if this ULExample object has a feature of the specified type, false if not.
Parameters
[in]featureTypethe desired feature
[out]featureValuethe integer feature value
bool ULExample::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 ULExample has a feature with the specified type.
Parameters
[in]featureTypethe type of the desired feature.
[out]featurethe desired feature.
const ULList< ULFeature > & ULExample::getFeatureList ( ) const
Returns
a const reference to this ULPartOfSpeech's feature list.
ULString ULExample::getText ( ) const
Returns
the text feature for this ULExample if one exists, or an empty string if one does not.
ULString ULExample::getTranslation ( ) const
Returns
the translation feature for this ULExample if one exists, or an empty string if one does not.
bool ULExample::hasFeature ( const ULFeatureType featureType) const
Returns
true if this ULExample has a feature with the specified feature type.
bool ULExample::operator!= ( const ULExample other) const

Inequality operator.

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

Assignment operator.

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

Equality operator.

void ULExample::setFeature ( const ULFeatureType featureType,
ULString  value 
)

If this ULExample'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.
ULString ULExample::toString ( ) const
Returns
a human-readable representation of this ULPartOfSpeech. TODO: include features

Member Data Documentation

ULList<ULFeature> ULExample::featureList
protected

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