IExternalDictionary Interface

This is the interface for an external dictionary. This interface and all its methods are implemented on the client-side. As it derives from the IUnknown interface, the client object should also implement the IUnknown methods.

ABBYY FineReader Engine objects allow working with the following dictionary types: standard, user, and regular-expression-based. If these dictionary types are not convenient for you, the IExternalDictionary interface allows you to implement your own dictionary type. You can attach your dictionary with the help of the SetDictionary method of the ExternalDictionaryDescription object. See the Working with Dictionaries section for details.

Guidelines for external dictionary creation

ABBYY FineReader Engine recognizes a word in a text and then passes it to an external dictionary together with the variants of recognition of each character in the word. The dictionary must select from all available combinations those combinations which belong to the dictionary, and return them through the IExternalDictionaryCallback callback interface. Note that the variants of recognition of each character include all variants that ABBYY FineReader Engine expects to find on each place in the word:

  • Letter case:
    • If the variants, provided by ABBYY FineReader Engine for one character, contain both uppercase and lowercase letter, then the dictionary must check the word with uppercase letter and the word with lowercase letter, and return both variants, if found.
    • If the variants for one character contain only lowercase letter, then the dictionary must return only word with lowercase letter.
    • If the variants for one character contain only lowercase letter, but the dictionary contains only word with uppercase letter, then the dictionary may confirm this combination or not at your discretion.
    • Generally, a word can have the following spelling variants: all the letters in the word are lowercase, the first letter is uppercase and others are lowercase, all the letters are uppercase. Therefore, we recommend that your dictionary contains only these variants for ordinary words.
  • Diacritics:
    • If the language allows both variants with and without diacritic, then the dictionary must be able to confirm both variants.
    • If the language allows only one variant of spelling, then the dictionary must confirm only this variant.
  • Character set:
    • The variants of character recognition passed to the dictionary include only characters which ABBYY FineReader Engine considered acceptable in the language. If some character is "unknown" for the dictionary, then the dictionary may replace this character with any character. The words with characters which are not acceptable in the alphabet of the language will be ignored by ABBYY FineReader Engine.
  • Hyphens:
    • ABBYY FineReader Engine deletes hyphens before passing the words to the dictionary. Therefore, if a hyphen appears in the passed variants, then it is the word with hyphen that ABBYY FineReader Engine wants to check.
    • ABBYY FineReader Engine passes the whole word to the dictionary. If a word is carried over to the next line without a hyphen, ABBYY FineReader tries to connect two parts, and then checks in the dictionary the result of connection.
  • Weights:
    • Standard weight for a word is 100.

Methods

Name Description
CheckPrefix Determines if the dictionary contains a word with the specified prefix.
CheckWords Delivers to the recognizer the information about strings in the collection which contains the dictionary words, with the help of the ExternalDictionaryResult method of the ExternalDictionaryCallback object.

Input parameter

The ExternalDictionary object is the input parameter of the IExternalDictionaryDescription::SetDictionary method.

Remarks

This interface does not work if the Engine object is loaded as an out-of-process server.

See also

IExternalDictionaryCallback

ExternalDictionaryDescription

Working with Dictionaries

7/3/2024 8:50:25 AM

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.