A class for containing linguistic items (arbitrary objects). Items are nodes in a relation which is again linked to an utterance. Items contain a key-value (string/SObject) set of features. An item can have a list of daughter items as well. Items can also be shared between relations.
The SItem structure.
Items are nodes in a relation which is again linked to an utterance. Items contain a key-value (string/object) set of features. An Item can have a list of daughter items as well. Items can be shared between relations.
The SItemClass structure.
Initialize a newly created item.
Set it’s relation and the content it must share with another item. If the given shared item is NULL, a new content is created.
Parameters: |
|
---|---|
Note: | If this function fails the item will be deleted and the self pointer will be set to NULL. Mostly for internal use, see SItemAppend, SItemPrepend, SItemAddDaughter, SRelationAppend and SRelationPrepend for the creation of items. |
Get the item next to the given one in the current relation.
Parameters: |
|
---|---|
Return: | Pointer to the next item. |
Get the item previous to the given one in the current relation.
Parameters: |
|
---|---|
Return: | Pointer to the prev item. |
Create a new item and append it after the given item self.
The new item will share it’s content with the given item toShare.
Parameters: |
|
---|---|
Return: | Pointer to appended item. |
Create a new item and prepend it before the given item self.
The new item will share it’s content with the given item toShare.
Parameters: |
|
---|---|
Return: | Pointer to prepended item. |
Returns the parent item of the given item.
Parameters: |
|
---|---|
Return: | Pointer to the parent item of the given item. |
Retrieve the first daughter item of the given item.
Parameters: |
|
---|---|
Return: | Pointer to the first daughter item of the given item. |
Retrieve the nth daughter item of the given item.
Parameters: |
|
---|---|
Parameters: |
|
Note: | Indexing starts at 0. |
Return: | Pointer to the nth daughter item of the given item. |
Retrieve the last daughter item of the given item.
Parameters: |
|
---|---|
Return: | Pointer to the last daughter item of the given item. |
Create a new item and add it as a daughter of the given item self.
The new item will share it’s content with the given item toShare. The new item will be appended to the last daughter of the given item.
Parameters: |
|
---|---|
Return: | Pointer to newly added daughter item. |
Get the given item’s name.
Parameters: |
|
---|---|
Return: | Pointer to the given item’s name. |
Set the given item’s name.
Parameters: |
|
---|
Query if named feature is present in the given item.
Parameters: |
|
---|---|
Return: |
Delete the named feature from the given item.
Parameters: |
|
---|
Get the keys of the features of the given item.
Parameters: |
|
---|---|
Return: | Pointer to a SList containing the keys of the features of the item. The list objects (keys) are string objects and are accessed with SObjectGetString. |
Note: | Caller is responsible for the memory of the returned SList object. |
Get the SObject of the named feature of the given item.
Parameters: |
|
---|---|
Return: | Pointer to the SObject object. |
Note: | If feature does not exist an S_ARGERROR will be raised, use SItemFeatureIsPresent to test if feature is present. |
Get the integer value of the named feature of the given item.
Parameters: |
|
---|---|
Return: | Integer value of named feature. |
Note: | If feature does not exist an S_ARGERROR will be raised, use SItemFeatureIsPresent to test if feature is present. |
Get the float value of the named feature of the given item.
Parameters: |
|
---|---|
Return: | Float value of named feature. |
Note: | If feature does not exist an S_ARGERROR will be raised, use SItemFeatureIsPresent to test if feature is present. |
Get the string value of the named feature of the given item.
Parameters: |
|
---|---|
Return: | Pointer to the string. |
Note: | If feature does not exist an S_ARGERROR will be raised, use SItemFeatureIsPresent to test if feature is present. |
Set the named feature to the given SObject object of the given item.
Parameters: |
|
---|
Set the named feature to the given integer value.
Parameters: |
|
---|
Extract items, item features and item functions by navigating given paths on the HRG structure (see HRG Path topic). Paths are strings that are composed of period (”.”) separated tokens describing the path of the requested item/feature, relative to a given item. The possible tokens are:
Token | Meaning |
---|---|
p | previous item |
n | next item |
daughter | first daughter item |
daughtern | last daughter item |
parent | parent item |
R:relname | item as it is in the given relation relname |
Extract an item, from the given path, relative to the given item.
Parameters: |
|
---|---|
Return: | The item from the path, relative to the given item. |
Extract an item feature, from the given path, relative to the given item.
Parameters: |
|
---|---|
Return: | The item feature from the path, relative to the given item. |
Execute the given feature processor , on the item from the given path, relative to the given item.
The name of the feature processor is the last element of the path.
Parameters: |
|
---|---|
Return: | The result of the feature processor executed on the item from the path, relative to the given item. |
Follow the given path, relative to the given item, and return the object at the path.
The object may be another item, a feature, or a feature that has been calculated by a feature processor . This function can be used as a replacement for SItemPathToItem, SItemPathToFeature or SItemPathToFeatProc.
Parameters: |
|
---|---|
Return: | The object at the end of the path, which may be another item, a item feature, or a feature that has been calculated by a feature processor. |
Note: | The returned object must be deleted by the caller with a call to S_DELETE. It is safe to do this call, regardless of whether the returned object was an item or a item feature. If a feature processor and an item feature has the same name then this function will not work. |
Get the relation of the given item.
Parameters: |
|
---|---|
Return: | Pointer to the given item’s relation. |
Get the utterance of the given item.
Parameters: |
|
---|---|
Return: | Pointer to the given item’s utterance. |