ULAPI  8.0
Public Member Functions | List of all members
ULDictionary Class Referenceabstract

ULDictionary is the abstract class describing a protocol for accessing mono- or bi-lingual dictionary data. More...

#include <uldictionary.h>

Public Member Functions

virtual ~ULDictionary ()
 
virtual ULError begin (const ULLanguage &searchLanguage, uluint32 indexID, ULDictionaryIterator &iterator)=0
 
virtual ULError end (const ULLanguage &searchLanguage, uluint32 indexID, ULDictionaryIterator &iterator)=0
 
virtual ULError find (const ULString &searchString, const ULLanguage &searchLanguage, uluint32 indexID, ULDictionaryIterator &iterator)=0
 
- Public Member Functions inherited from ULWorker
 ULWorker ()
 
virtual ~ULWorker ()
 
virtual bool isServiceAvailable (const ULServiceDescriptor &service)=0
 
virtual void getAvailableServices (ULList< ULServiceDescriptor > &serviceList)=0
 
virtual void setCancelOperation (bool shouldCancel)
 
virtual bool shouldCancelOperation () const
 

Detailed Description

ULDictionary is the abstract class describing a protocol for accessing mono- or bi-lingual dictionary data.

Constructor & Destructor Documentation

virtual ULDictionary::~ULDictionary ( )
inlinevirtual

Member Function Documentation

virtual ULError ULDictionary::begin ( const ULLanguage searchLanguage,
uluint32  indexID,
ULDictionaryIterator iterator 
)
pure virtual

Creates an iterator pointing to the first ULDictionaryNode in the set of nodes associated with the specified index. An "index" in this context refers to a sorted list of strings in the data source associated with this ULDictionary object. The most common index is the "headword" index, which is an alphabetized list of labels for dictionary entries. Other indexes may support searching for dictionary entries whose definitions contain the search string, or whose "domain" labels (e.g. "Cooking", "Botany", "Computers", "Sports") match the search string, etc.

Returns
ULError::NoError, ULError::MemoryAllocationFailed, or ULError::DataSourceOpenFailed.
Parameters
[in]searchLanguageFor bilingual dictionaries, this indicates the language of the index in question. (For example, an English-Spanish data source would have both an English headword index and a Spanish headword index, and searchLanguage would tell begin() which of these indexes to use.)
[in]indexIDAn enumerated value specifying which index to search.
[out]iteratorAn iterator pointing to the first ULDictionaryNode associated with the specified index.

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULDefiner.

virtual ULError ULDictionary::end ( const ULLanguage searchLanguage,
uluint32  indexID,
ULDictionaryIterator iterator 
)
pure virtual

Creates an iterator pointing to the end of the list of ULDictionaryNodes associated with the specified index. An "index" in this context refers to a sorted list of strings in the data source associated with this ULDictionary object. The most common index is the "headword" index, which is an alphabetized list of labels for dictionary entries. Other indexes may support searching for dictionary entries whose definitions contain the search string, or whose "domain" labels (e.g. "Cooking", "Botany", "Computers", "Sports") match the search string, etc.

Returns
ULError::NoError, ULError::MemoryAllocationFailed, or ULError::DataSourceOpenFailed.
Parameters
[in]searchLanguageFor bilingual dictionaries, this indicates the language of the index in question. (For example, an English-Spanish data source would have both an English headword index and a Spanish headword index, and searchLanguage would tell begin() which of these indexes to use.)
[in]indexIDAn enumerated value specifying which index to search.
[out]iteratorAn iterator pointing to the end of the ULDictionaryNode list associated with the specified index.

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULDefiner.

virtual ULError ULDictionary::find ( const ULString searchString,
const ULLanguage searchLanguage,
uluint32  indexID,
ULDictionaryIterator iterator 
)
pure virtual

Searches the data source(s) associated with this ULDictionary for the closest match to the specified search string, using the specified language and index. An "index" in this context refers to a sorted list of strings in the data source associated with this ULDictionary object. The most common index is the "headword" index, which is an alphabetized list of labels for dictionary entries. Other indexes may support searching for dictionary entries whose definitions contain the search string, or whose "domain" labels (e.g. "Cooking", "Botany", "Computers", "Sports") match the search string, etc.

The "closest match" found by this method is closest in the sense of a binary search on a sorted list. More specifically, the closest match is the lexicographically smallest item in the specified index that is greater than or equal to the search string. Thus, for example, if you search for "sp" in English, you'll get an iterator pointing to the first English word starting with "sp" or "Sp" (e.g. "spa").

Returns
ULError::NoError, ULError::MemoryAllocationFailed, or ULError::DataSourceOpenFailed.
Parameters
[in]searchStringThe string you're looking for.
[in]searchLanguageFor bilingual dictionaries, this specifies the direction in which to search–i.e. the language in which searchString is to be interpreted.
[in]indexIDAn enumerated value specifying which index to search.
[out]iteratorAn iterator pointing to the closest match in the specified index. This iterator will point to a top-level ULDictionaryNode (i.e. one with no parent node).

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULDefiner.


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