ULAPI
8.0
|
A ULDictionaryNode represents a unit of data from a ULDictionary. More...
#include <uldictionarynode.h>
Public Member Functions | |
ULDictionaryNode () | |
ULDictionaryNode (const ULDictionaryNode &other) | |
virtual | ~ULDictionaryNode () |
ULDictionaryNode & | operator= (const ULDictionaryNode &other) |
void | clear () |
uluint32 | getType () const |
void | setType (uluint32 newType) |
ULDictionaryDataSource * | getDataSource () |
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 |
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...)
ULDictionaryNode::ULDictionaryNode | ( | ) |
Default constructor.
ULDictionaryNode::ULDictionaryNode | ( | const ULDictionaryNode & | other | ) |
Copy constructor.
|
virtual |
Destructor.
void ULDictionaryNode::addFeature | ( | const ULFeature & | feature | ) |
Appends the specified feature to this node's feature list.
[in] | feature | the desired feature. |
void ULDictionaryNode::clear | ( | ) |
Sets this node to its default state.
ULDictionaryDataSource * ULDictionaryNode::getDataSource | ( | ) |
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.
[in] | featureType | the type of the desired feature. |
[out] | feature | the 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.
[in] | featureTypeStringID | the string ID of the desired feature type. |
[out] | feature | the desired feature. |
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.
[in] | featureType | the type of the desired feature. |
[out] | featureList | the desired feature list. |
uluint32 ULDictionaryNode::getType | ( | ) | const |
bool ULDictionaryNode::hasFeature | ( | const ULFeatureType & | featureType | ) | const |
[in] | featureType | the type of the desired feature. |
bool ULDictionaryNode::hasFeature | ( | const char * | featureTypeStringID | ) | const |
[in] | featureTypeStringID | the 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.
[in] | newDataSource | A pointer to the desired data source. |
void ULDictionaryNode::setType | ( | uluint32 | newType | ) |
Sets this node's type.
[in] | newType | the desired type |
ULString ULDictionaryNode::toString | ( | int | level = 0 | ) | const |
[in] | level | The 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. |