A worker that looks up words in bilingual or monolingual dictionary data sources and supplies definitions for those words.
More...
|
| ULDefiner () |
|
| ULDefiner (const ULDefiner &other) |
|
virtual | ~ULDefiner () |
|
ULDefiner & | operator= (const ULDefiner &other) |
|
virtual void | clear () |
|
virtual bool | isServiceAvailable (const ULServiceDescriptor &service) |
|
virtual void | getAvailableServices (ULList< ULServiceDescriptor > &serviceList) |
|
void | setDictionaryDataSource (ULDictionaryDataSource *dataSource) |
|
ULDictionaryDataSource * | getDictionaryDataSource () |
|
void | setFirstStemmer (ULStemmer *stemmer) |
|
ULStemmer * | getFirstStemmer () |
|
void | setSecondStemmer (ULStemmer *stemmer) |
|
ULStemmer * | getSecondStemmer () |
|
virtual ULError | begin (const ULLanguage &searchLanguage, uluint32 indexID, ULDictionaryIterator &iterator) |
|
virtual ULError | end (const ULLanguage &searchLanguage, uluint32 indexID, ULDictionaryIterator &iterator) |
|
virtual ULError | find (const ULString &s, const ULLanguage &searchLanguage, uluint32 indexID, ULDictionaryIterator &iterator) |
|
ULError | simpleFind (const ULString &s, const ULLanguage &searchLanguage, ULDictionaryIterator &iterator) |
|
ULError | find (const ULString &searchString, const ULLanguage &searchLanguage, ULDictionaryIterator &dictionaryIterator) |
|
ULError | getHeadwordSearchResults (const ULString &originalSearchString, const ULLanguage &searchLanguage, uluint32 maxBrowsingResults, uluint32 approximateRequiredPrefixLength, ULList< ULDerivation > &stemmingMatches, ULList< ULDerivation > &substringMatches, ULList< ULDerivation > &approximateMatches) |
|
ULError | lookUp (const ULString &searchString, const ULLanguage &searchLanguage, ULList< ULDictionaryIterator > &results) |
|
virtual | ~ULDictionary () |
|
| ULWorker () |
|
virtual | ~ULWorker () |
|
virtual void | setCancelOperation (bool shouldCancel) |
|
virtual bool | shouldCancelOperation () const |
|
A worker that looks up words in bilingual or monolingual dictionary data sources and supplies definitions for those words.
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). |
Implements ULDictionary.
Searches this ULDefiner's data source for the term whose text matches the specified search string most closely, using the specified language.
The "closest match" found by this method is more complex than that found by ULDefiner::simpleFind. If searchString consists of a single word, the search of the data source's headword index is case- and accent-insensitive, but will favor an exact match over an inexact one. For example, if you search for "polish", the resulting iterator will typically point to "polish [noun]", while if you search for "Polish", it will point to "Polish [adjective]".
If searchString has more than one word, each token (defined roughly as non-stopword words in the string) is used in turn to search the headword index. If a case-/accent-insensitive match between token and headword is found, all terms filed under that headword are searched until a term whose text contains searchString (again, insensitively). For example, if you search for "wrong foot", a match would typically be found under "foot" at the term "get off on the wrong foot". If no multi-word match is found, then an ordinary binary search of the headword index is performed using searchString as a best-effort fall-back. For example, "wong foot" would likely land at "wont [noun]".
- 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. |
[out] | iterator | An iterator pointing to the closest match. This iterator will point to a top-level ULDictionaryNode. |
Searches this ULDefiner's data source for the headword that matches the specified search string most closely, using the specified language.
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. |
[out] | iterator | An iterator pointing to the closest match. This iterator will point to a top-level ULDictionaryNode. |