ULDictionary is the abstract class describing a protocol for accessing mono- or bi-lingual dictionary data.
More...
#include <uldictionary.h>
ULDictionary is the abstract class describing a protocol for accessing mono- or bi-lingual dictionary data.
virtual ULDictionary::~ULDictionary |
( |
| ) |
|
|
inlinevirtual |
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] | searchLanguage | For 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] | indexID | An enumerated value specifying which index to search. |
[out] | iterator | An iterator pointing to the first ULDictionaryNode associated with the specified index. |
Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULDefiner.
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] | searchLanguage | For 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] | indexID | An enumerated value specifying which index to search. |
[out] | iterator | An iterator pointing to the end of the ULDictionaryNode list associated with the specified index. |
Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULDefiner.
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] | searchString | The string you're looking for. |
[in] | searchLanguage | For bilingual dictionaries, this specifies the direction in which to search–i.e. the language in which searchString is to be interpreted. |
[in] | indexID | An enumerated value specifying which index to search. |
[out] | iterator | An 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: