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

A ULDictionaryNode represents a unit of data from a ULDictionary. More...

#include <uldictionarynode.h>

Public Member Functions

 ULDictionaryNode ()
 
 ULDictionaryNode (const ULDictionaryNode &other)
 
virtual ~ULDictionaryNode ()
 
ULDictionaryNodeoperator= (const ULDictionaryNode &other)
 
void clear ()
 
uluint32 getType () const
 
void setType (uluint32 newType)
 
ULDictionaryDataSourcegetDataSource ()
 
void setDataSource (ULDictionaryDataSource *newDataSource)
 
bool hasFeature (const ULFeatureType &featureType) const
 
bool hasFeature (const char *featureTypeStringID) const
 
bool getFeature (const ULFeatureType &featureType, ULFeature &feature) const
 
bool getFeatures (const ULFeatureType &featureType, ULList< ULFeature > &featureList) const
 
bool getFeature (const char *featureTypeStringID, ULFeature &feature) const
 
void addFeature (const ULFeature &feature)
 
const ULList< ULFeature > & getFeatureList () const
 
ULString toString (int level=0) const
 

Detailed Description

A ULDictionaryNode represents a unit of data from a ULDictionary.

ULDictionaryNodes can form a tree (since each node contains a list of child nodes). Each node also contains a list of (name, value) pairs called "features."

As a concrete example, consider the entry "stop" in an English-Spanish dictionary. The entry as a whole would be a single node with the feature ("headword", "stop"). This node would have two child nodes, one with feature ("partOfSpeech", "n.") and the other with feature ("partOfSpeech", "v."). In turn, the noun subnode would have child nodes of their own representing the Spanish translations of "stop" the noun and "stop" the verb.

Roughly, the "stop" node might look like this:

Node
   headword="stop"
   pronunciation="sta:p"
   Node
       text="stop"
       partOfSpeech="n."
       Node
           text="alto"
           partOfSpeech="s.m."
       Node
           text="pausa"
           partOfSpeech="s.f."
       (...more child Nodes...)
   Node
       text="stop"
       partOfSpeech="v."
       Node
           text="detener"
           partOfSpeech="v."
       Node
           text="sobreseer"
           partOfSpeech="v."
           context="(~ a petition, etc.)
       (...more child Nodes...)

Constructor & Destructor Documentation

ULDictionaryNode::ULDictionaryNode ( )

Default constructor.

ULDictionaryNode::ULDictionaryNode ( const ULDictionaryNode other)

Copy constructor.

ULDictionaryNode::~ULDictionaryNode ( )
virtual

Destructor.

Member Function Documentation

void ULDictionaryNode::addFeature ( const ULFeature feature)

Appends the specified feature to this node's feature list.

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

Sets this node to its default state.

ULDictionaryDataSource * ULDictionaryNode::getDataSource ( )
Returns
a pointer to the dictionary data source from which this node's data comes.
bool ULDictionaryNode::getFeature ( const ULFeatureType featureType,
ULFeature feature 
) const

Gets the feature associated with the specified featureType, if any such value exists in this node's feature list.

Returns
true if this node has a feature with the specified type.
Parameters
[in]featureTypethe type of the desired feature.
[out]featurethe desired feature.
bool ULDictionaryNode::getFeature ( const char *  featureTypeStringID,
ULFeature feature 
) const

Gets the value associated with the specified feature type string ID, if any such value exists in this node's feature list.

Returns
true if this node has a feature with the specified name.
Parameters
[in]featureTypeStringIDthe string ID of the desired feature type.
[out]featurethe desired feature.
const ULList< ULFeature > & ULDictionaryNode::getFeatureList ( ) const
Returns
a reference to this node's feature list.
bool ULDictionaryNode::getFeatures ( const ULFeatureType featureType,
ULList< ULFeature > &  featureList 
) const

Gets the features associated with the specified featureType, if any such value exists in this node's feature list.

Returns
true if this node has at least one feature with the specified type.
Parameters
[in]featureTypethe type of the desired feature.
[out]featureListthe desired feature list.
uluint32 ULDictionaryNode::getType ( ) const
Returns
the node's type (which is a feature ID).
bool ULDictionaryNode::hasFeature ( const ULFeatureType featureType) const
Returns
true if this node has a feature with the specified type.
Parameters
[in]featureTypethe type of the desired feature.
bool ULDictionaryNode::hasFeature ( const char *  featureTypeStringID) const
Returns
true if this node has a feature with the specified name.
Parameters
[in]featureTypeStringIDthe string ID of the desired feature.
ULDictionaryNode & ULDictionaryNode::operator= ( const ULDictionaryNode other)

Assignment operator.

void ULDictionaryNode::setDataSource ( ULDictionaryDataSource newDataSource)

Sets the data source for this node.

Parameters
[in]newDataSourceA pointer to the desired data source.
void ULDictionaryNode::setType ( uluint32  newType)

Sets this node's type.

Parameters
[in]newTypethe desired type
ULString ULDictionaryNode::toString ( int  level = 0) const
Returns
a simple human-readable representation of this node.
Parameters
[in]levelThe level of the node within a larger tree. This value is used to insert indentation in front of each line of text in the resulting string. No indentation is the default.

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