RecAPI
|
Spell checking for accuracy improvement. More...
Defines | |
#define | DICTDESCLEN 64 |
The maximum length of the vertical dictionary description (including the terminating zero) | |
#define | MAXUDITEMLEN 64 |
Maximal character length needed for user dictionary items. | |
Typedefs | |
typedef CHECKWORDRETURNCODE * | LPCHECKWORDRETURNCODE |
Deprecated. This functionality is no longer supported in CSDK18. It will be removed from the next version of the CSDK. | |
typedef const CHECKWORDRETURNCODE * | LPCCHECKWORDRETURNCODE |
Deprecated. This functionality is no longer supported in CSDK18. It will be removed from the next version of the CSDK. | |
typedef DWORD RECKRNCALL | CHECKWORD_CB (int nZone, LPCWSTR pTobechecked, LPCHECKWORDRETURNCODE pOpinion, void *pReserved) |
Deprecated. This functionality is no longer supported in CSDK18. It will be removed from the next version of the CSDK. | |
typedef CHECKWORD_CB * | LPCHECKWORD_CB |
Deprecated. This functionality is no longer supported in CSDK18. It will be removed from the next version of the CSDK. | |
typedef char | VDICTDESC [DICTDESCLEN] |
Type for storing the description of a vertical dictionary. | |
Enumerations | |
enum | CHECKWORDRETURNCODE |
Deprecated. This functionality is no longer supported in CSDK18. It will be removed from the next version of the CSDK. | |
enum | UDSAVESTYLE { UDSS_INTERNAL, UDSS_ORIGINAL, UDSS_TEXT, UDSS_UNICODE_TEXT } |
User dictionary saving styles. More... | |
Functions | |
RECERR RECAPIKRN | kRecSetSpell (int sid, INTBOOL bChksubsystem) |
Enabling checking module. | |
RECERR RECAPIKRN | kRecGetSpell (int sid, INTBOOL *pEnable) |
Inquiring whether the checking module is enabled. | |
RECERR RECAPIKRN | kRecSetSpellCorrection (int sid, INTBOOL bCorrection) |
Retained only for compatibility. | |
RECERR RECAPIKRN | kRecGetSpellCorrection (int sid, LPINTBOOL pCorrection) |
Retained only for compatibility. | |
RECERR RECAPIKRN | kRecGetFirstSpellLanguage (LANGUAGES *pLang) |
Starting enumeration of spell languages. | |
RECERR RECAPIKRN | kRecGetNextSpellLanguage (LANGUAGES *pLang) |
Performing enumeration of spell languages. | |
RECERR RECAPIKRN | kRecSetSpellLanguage (int sid, LANGUAGES SpellLang) |
Setting spell language. | |
RECERR RECAPIKRN | kRecGetSpellLanguage (int sid, LANGUAGES *pSpellLang) |
Getting spelling language. | |
RECERR RECAPIKRN | kRecGetFirstVerticalDict (LANGUAGES *pLang, VDICTDESC name) |
Starting enumeration of vertical dictionaries. | |
RECERR RECAPIKRN | kRecGetNextVerticalDict (LANGUAGES *pLang, VDICTDESC name) |
Performing enumeration of vertical dictionaries. | |
RECERR RECAPIKRN | kRecSetVerticalDictionaries (int sid, VDICTDESC *names, int nNames) |
Setting vertical dictionaries. | |
RECERR RECAPIKRN | kRecGetVerticalDictionaries (int sid, VDICTDESC *name, int nBuffers, int *nNames) |
Getting vertical dictionaries. | |
RECERR RECAPIKRN | kRecSetUserDictionary (int sid, LPCTSTR pFilename, LPCTSTR pDefaultSection) |
Setting user dictionary. | |
RECERR RECAPIKRN | kRecGetUserDictionary (int sid, LPTSTR pFilename, size_t iSize1, LPTSTR pDefaultSection, size_t iSize2) |
Getting user dictionary. | |
RECERR RECAPIKRN | kRecOpenMaintenanceUD (int sid) |
Opening user dictionary for editing. | |
RECERR RECAPIKRN | kRecGetUDState (int sid, LPINTBOOL pChanged) |
Inquiring whether the user dictionary is changed. | |
RECERR RECAPIKRN | kRecSaveUD (int sid, LPCTSTR pFilename, UDSAVESTYLE saveStyle) |
Saving user dictionary. | |
RECERR RECAPIKRN | kRecCloseMaintenanceUD (int sid) |
Closing a user dictionary opened for editing. | |
RECERR RECAPIKRN | kRecGetFirstSectionUD (int sid, LPTSTR pSection, size_t buflen) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. | |
RECERR RECAPIKRN | kRecGetNextSectionUD (int sid, LPTSTR pSection, size_t buflen) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. | |
RECERR RECAPIKRN | kRecGetFirstItemUD (int sid, LPCTSTR pSection, LPWSTR pUDitem, size_t buflen, LPDWORD pitemattrib) |
Starting enumeration of UDitems. | |
RECERR RECAPIKRN | kRecGetNextItemUD (int sid, LPWSTR pUDitem, size_t buflen, LPDWORD pitemattrib) |
Performing enumeration of items. | |
RECERR RECAPIKRN | kRecDeleteSectionUD (int sid, LPCTSTR section) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. | |
RECERR RECAPIKRN | kRecAddItemUD (int sid, LPCTSTR pSection, LPCWSTR pUDitem, DWORD itemattrib) |
Adding an item to the user dictionary. | |
RECERR RECAPIKRN | kRecAddListUD (int sid, LPCTSTR pFilename, LPCSTR section) |
Adding a user dictionary to an other one. | |
RECERR RECAPIKRN | kRecDeleteItemUD (int sid, LPCTSTR pSection, LPCWSTR pUDitem, DWORD itemattrib) |
Removing an item from the user dictionary. | |
RECERR RECAPIKRN | kRecGetSectionCount (int sid, size_t *pSectCount) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. | |
RECERR RECAPIKRN | kRecGetSection (int sid, size_t nSectIndex, LPTSTR pSectName, size_t buflen) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. | |
RECERR RECAPIKRN | kRecGetItemCount (int sid, size_t nSectIndex, size_t *pItemCount) |
Getting the number of items in the user dictionary. | |
RECERR RECAPIKRN | kRecGetSectItem (int sid, size_t nSectIndex, size_t nItemIndex, LPWSTR pItem, size_t iBufSize, LPDWORD pFlag) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. | |
RECERR RECAPIKRN | kRecGetSectionIndex (int sid, LPCTSTR pSection, size_t *pIndex) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. | |
RECERR RECAPIKRN | kRecGetLastInsertPos (int sid, size_t nSectIndex, size_t *pPos) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. | |
RECERR RECAPIKRN | kRecCreateEmptySection (int sid, LPCTSTR pSectName) |
Deprecated. This functionality is no longer supported in CSDK18-19. It will be removed from the next version of the CSDK. |
Spell checking for accuracy improvement.
This module has an effect during recognition only when the following configurations are used:
RM_OMNIFONT_PLUS3W
,RM_OMNIFONT_PLUS2W
,RM_OMNIFONT_MOR
,RM_MAT
,RM_HNR
.The modules MAT and HNR are supported on: Windows, PLUS3W is supported on: Windows, Linux.
IMPORTANT NOTE: This module runs as part of the OCR engine processing, not as a separated post-processing step. Thus it may help the engines to improve the OCR result, but it cannot rewrite all the results from the OCR. It is always the OCR engine that is responsible for deciding how it uses the opinions coming from the Spell module, i.e. it is not the Spell Module that really modifies the result.
The checking module consists of two separate and independent parts, their combination can be enabled. They determine the acceptability of words and run in the following order:
The running order means that if an earlier step declares that a word is possible, the later ones do not re-evaluate it and will not change the decision.
Remember that this checking can still be enabled or disabled separately at the zone level.
The UD-checking runs only when the spell language setting (kRecSetSpellLanguage) is set to LANG_AUTO, LANG_UD or LANG_NO. The Spell checking does not run when this setting is LANG_UD
or LANG_NO
.
Spell checking uses third-party language-specific spell checkers. There are two kinds of the spell checkers:
Language dictionaries:
The OmniPage CSDK v20 is delivered with 21 different Language dictionary files. These are generic language dictionaries; they contain between 100,000 and 200,000 entries. You can delete or remove any or all of them, but if you want to use a spell language after removing its file the result is undetermined. See the list about the supported spelling languages and the appropriate language dictionary files.
Vertical dictionaries: these are based on specific professions. They can be treated as extensions to the language dictionaries, but they can also be used when no Language dictionary is specified.
The Capture SDK is delivered with 9 different Vertical dictionaries.
Specifying the Spelling language (kRecSetSpellLanguage) (that is, the Language dictionary) and/or a Vertical dictionary (kRecSetVerticalDictionaries) are page-level settings. Once a Language dictionary is specified, the language checking will be applied to all zones on the page, unless their CHK_LANGDICT_PROHIBIT flag is set.
Similarly, once a Vertical dictionary is specified, the vertical language checking will be applied to all zones on the page, unless their CHK_VERTDICT_PROHIBIT flag is set.
When the Spelling language is set to LANG_NO, or when it specifies a language for which there is no Language dictionary, the language checking will not be activated for the page zones.
In the default case, with the Spelling language set to LANG_AUTO, language checking will be based on the recognition language selection (kRecSetLanguages) as follows:
The checking module also uses User dictionaries (kRecSetUserDictionary). A User dictionary is a collection of user-specific elements, so-called UDitems. A UDitem is a word as in the case of any wordprocessor's user dictionary.
User dictionary items are UNICODE strings and they must be no longer than MAXUDITEMLEN characters (including the terminating zero). They may contain spaces and punctuation characters.
A string under checking will be accepted if it conforms to at least one item of the User dictionary.
You may find UD-checking particularly useful in several scenarios:
In such cases, the application can reduce unwanted marking and improve recognition accuracy by performing UD-checking. Assuming that the User Dictionary has been already prepared (by adding the required words to it), this will supplement spell checking. That is, in this case, UD-checking is complementary to spell checking.
UD-checking without enabled spell checking is typically used in form-like applications (e.g. questionnaires), or in any scenario where the data to be recognized is highly structured and follows predictable patterns.
Specifying the User dictionary file itself is a page-level setting. Once one is specified, it will be applied to all zones on the page. You can disable UD-checking for specific zones using the CHK_USERDICT_PROHIBIT flag.
User Dictionaries can also be created or modified by KernelAPI calls: kRecOpenMaintenanceUD, kRecCloseMaintenanceUD, kRecAddItemUD, kRecSaveUD, etc.
The LETTER structure contains the fields lang
and lang2
to specify the language of the word. There is also a flag in the info
field for marking dictionary words. They are used as follows:
lang | lang2 | RR_DICTIONARY_WORD | |
Non-dictionary word | language of the zone* | LANG_NO | false |
User dictionary word | LANG_UD | LANG_NO | true |
Single-dictionary word | LANG_*** | LANG_NO | true |
Multi-dictionary word | primary LANG_*** | secondary LANG_*** | true |
* The language of the zone is the most used language in the zone.
See also the section The notion of word in CSDK. In some cases parts of a dashed word could have different languages, for example "semi-doux".
The LETTER::err field is a combined value. Its most significant bit is used to express the certainty/uncertainty of the word. (If this bit is set to 1, the word is uncertain RE_SUSPECT_WORD.) The remaining bits express the certainty of the character recognition. A value close to 0 means that the Engine recognized the character with high confidence. A value close to 99 means low confidence. A value of 100 or above means a rejected character. In some cases a word may have some or all characters that are individually suspicious but the characters are not marked as such in the word bit. This is usually a result of language or user dictionary checking, meaning that the word was validated by the checking module.
Applications that examine the character confidence information can use a threshold value, above which the character code is treated as a suspicious result. A value of 64 is recommended for this purpose (RE_SUSPECT_THR). A value less than 64 will indicate that the character was recognized with high confidence. A value of 64 or greater marks that the code is suspicious.
enum UDSAVESTYLE |
User dictionary saving styles.
This enum type specifies the possible output styles at saving user dictionary. It can be used at calling kRecSaveUD.
RECERR RECAPIKRN kRecAddItemUD | ( | int | sid, |
LPCTSTR | pSection, | ||
LPCWSTR | pUDitem, | ||
DWORD | itemattrib | ||
) |
Adding an item to the user dictionary.
The kRecAddItemUD function adds a new user dictionary item (or simply UDitem) that is a word to the user dictionary currently opened for editing by kRecOpenMaintenanceUD.
[in] | sid | Settings Collection ID. |
[in] | pSection | Deprecated. It must be NULL or empty string. |
[in] | pUDitem | Pointer to a UNICODE string containing the item to be added. |
[in] | itemattrib | Unused parameter. It must be 0. |
RECERR |
RECERR rc; LPSTR dictname = "USERDIC1.DIC"; LPCWSTR itemtobeadded1 = L"Los Gatos"; LPCWSTR itemtobeadded2 = L"Budapest"; rc = kRecSetUserDictionary(sid, NULL, NULL); rc = kRecOpenMaintenanceUD(sid); rc = kRecAddItemUD(sid, NULL, itemtobeadded1, 0); rc = kRecAddItemUD(sid, NULL, itemtobeadded2, 0); rc = kRecSaveUD(sid, dictname, FALSE); rc = kRecCloseMaintenanceUD(sid); rc = kRecSetUserDictionary(sid, dictname, NULL);
RECERR kRecAddItemUD(int sid, string section, string pUDitem, uint itemattrib);
RECERR RECAPIKRN kRecAddListUD | ( | int | sid, |
LPCTSTR | pFilename, | ||
LPCSTR | section | ||
) |
Adding a user dictionary to an other one.
This function adds all the items of a user dictionary to the one that is opened for maintenance. The specified user dictionary can be in the UD format of the CSDK or a simple word list as well.
[in] | sid | Settings Collection ID. |
[in] | pFilename | The name of the user dictionary to be added. |
[in] | section | Deprecated. It must be NULL. |
RECERR |
RECERR kRecAddListUD(int sid, string filename, string section, bool keepSection);
RECERR RECAPIKRN kRecCloseMaintenanceUD | ( | int | sid | ) |
Closing a user dictionary opened for editing.
The kRecCloseMaintenanceUD function closes the user dictionary previously opened by the kRecOpenMaintenanceUD function.
[in] | sid | Settings Collection ID. |
RECERR |
RECERR kRecCloseMaintenanceUD(int sid);
RECERR RECAPIKRN kRecDeleteItemUD | ( | int | sid, |
LPCTSTR | pSection, | ||
LPCWSTR | pUDitem, | ||
DWORD | itemattrib | ||
) |
Removing an item from the user dictionary.
The kRecDeleteItemUD function deletes a word from the user dictionary currently opened for editing by kRecOpenMaintenanceUD.
[in] | sid | Settings Collection ID. |
[in] | pSection | Deprecated. It must be NULL or empty string. |
[in] | pUDitem | Pointer to a UNICODE string containing the word to be deleted. (The string is terminated with a wide-character zero.) |
[in] | itemattrib | Unused parameter. It must be 0. |
RECERR |
RECERR kRecDeleteItemUD(int sid, string pSection, string pUDitem, uint itemattrib);
RECERR RECAPIKRN kRecGetFirstItemUD | ( | int | sid, |
LPCTSTR | pSection, | ||
LPWSTR | pUDitem, | ||
size_t | buflen, | ||
LPDWORD | pitemattrib | ||
) |
Starting enumeration of UDitems.
The kRecGetFirstItemUD function (together with the kRecGetNextItemUD) function creates an item-list from the currently opened user dictionary. This function returns the first item of the user dictionary.
[in] | sid | Settings Collection ID. |
[in] | pSection | Deprecated. It must be NULL or empty string. |
[out] | pUDitem | Pointer of a buffer to get the first item of the item-list. (UNICODE string.) |
[in] | buflen | Specifies the size of the buffer in bytes. |
[out] | pitemattrib | Unused parameter. It must be NULL. |
RECERR |
RECERR kRecGetFirstItemUD(int sid, string pSection, out string pUDitem, out uint pitemattrib);
kRecGetFirstItemUD
and kRecGetNextItemUD in C#: RECERR kRecGetAllItemsUD(int sid, out string[] itemnames, out uint[] itemattribs);
Starting enumeration of spell languages.
The kRecGetFirstSpellLanguage (together with the kRecGetNextSpellLanguage function) creates a listing of the available Spelling languages. The function returns with the LANGUAGES language identifier of the first Spelling language available for the current Engine configuration.
[out] | pLang | Address of a variable to get the first language. |
RECERR |
SPL_NOMORE_WARN
. RECERR kRecGetFirstSpellLanguage(out LANGUAGES pLang);
kRecGetFirstSpellLanguage
and kRecGetNextSpellLanguage in C#: RECERR kRecGetAllSpellLanguages(out LANGUAGES[] spelllangs);
Starting enumeration of vertical dictionaries.
This function (together with kRecGetNextVerticalDict) enumerates the available vertical dictionaries. It gives the first of them. It retrieves the identifier of the language the vertical dictionary belongs to and the name of this dictionary.
[out] | pLang | Pointer of a variable to store the identifier of the language the dictionary belongs to. |
[out] | name | Pointer of a string buffer for getting the description of the dictionary. |
RECERR |
kRecGetFirstVerticalDict
and kRecGetNextVerticalDict
are not thread safe. It is recommended to use them in the main thread after the starting of the application, since this list is invariable during the whole running time. SPL_NOMORE_WARN
. RECERR kRecGetFirstVerticalDict(out LANGUAGES pLang, out string name);
kRecGetFirstVerticalDict
and kRecGetNextVerticalDict in C#: RECERR kRecGetAllVerticalDicts(out LANGUAGES[] vertdictlangs, out string[] vertdicts);
RECERR RECAPIKRN kRecGetItemCount | ( | int | sid, |
size_t | nSectIndex, | ||
size_t * | pItemCount | ||
) |
Getting the number of items in the user dictionary.
This function retrieves the number of items in the current user dictionary.
[in] | sid | Settings Collection ID. |
[in] | nSectIndex | Deprecated. It must be 0. |
[out] | pItemCount | Pointer of a variable to store the number of items. |
RECERR |
RECERR kRecGetItemCount(int sid, uint nSectIndex, out uint pItemCount);
RECERR RECAPIKRN kRecGetNextItemUD | ( | int | sid, |
LPWSTR | pUDitem, | ||
size_t | buflen, | ||
LPDWORD | pitemattrib | ||
) |
Performing enumeration of items.
The kRecGetNextItemUD function (together with the kRecGetFirstItemUD function creates an item-list from the currently opened user dictionary. This function retrieves the next item.
[in] | sid | Settings Collection ID. |
[out] | pUDitem | Pointer of a buffer to get the first item of the item-list. (UNICODE string.) |
[in] | buflen | Specifies the size of the buffer in bytes. |
[out] | pitemattrib | Unused parameter. It must be NULL. |
RECERR |
REC_OK
each time. As soon as the function finds no further item to get, it returns with SPL_NOMORE_WARN
, signaling that the list is complete. RECERR kRecGetNextItemUD(int sid, out string pUDitem, out uint pitemattrib);
kRecGetNextItemUD
in C#: RECERR kRecGetAllItemsUD(int sid, out string[] itemnames, out uint[] itemattribs);
Performing enumeration of spell languages.
The kRecGetNextSpellLanguage function (together with the kRecGetFirstSpellLanguage function) creates a listing of the available Spelling languages.
[out] | pLang | Address of a variable to get the next spelling language. |
RECERR |
REC_OK
each time. As soon as the function finds no further language to get, it returns with SPL_NOMORE_WARN
, signaling that the list is complete. RECERR kRecGetNextSpellLanguage(out LANGUAGES pLang);
kRecGetNextSpellLanguage
in C#: RECERR kRecGetAllSpellLanguages(out LANGUAGES[] spelllangs);
Performing enumeration of vertical dictionaries.
This function (together with kRecGetFirstVerticalDict) enumerates the available vertical dictionaries. It gives the next one. It retrieves the identifier of the language the vertical dictionary belongs to and the name of this dictionary.
[out] | pLang | Pointer of a variable to store the identifier of the language the dictionary belongs to. |
[out] | name | Pointer of a string buffer for getting the description of the dictionary. |
RECERR |
kRecGetFirstVerticalDict
and kRecGetNextVerticalDict
are not thread safe. It is recommended to use them in the main thread after starting the application, since this list is invariable during the whole running time. SPL_NOMORE_WARN
, otherwise with REC_OK
. RECERR kRecGetNextVerticalDict(out LANGUAGES pLang, out string name);
kRecGetNextVerticalDict
in C#: RECERR kRecGetAllVerticalDicts(out LANGUAGES[] vertdictlangs, out string[] vertdicts);
RECERR RECAPIKRN kRecGetSpell | ( | int | sid, |
INTBOOL * | pEnable | ||
) |
Inquiring whether the checking module is enabled.
The kRecGetSpell function inquires whether the checking module is enabled or disabled. (See kRecSetSpell.)
[in] | sid | Settings Collection ID. |
[out] | pEnable | Address of a flag to get status: TRUE enabled, FALSE disabled. |
RECERR |
RECERR kRecGetSpell(int sid, out bool bChksubsystem);
Getting spelling language.
The kRecGetSpellLanguage function inquires the current spelling language setting of the checking module.
[in] | sid | Settings Collection ID. |
[out] | pSpellLang | Address of a variable to get the current Spelling language setting. |
RECERR |
RECERR kRecGetSpellLanguage(int sid, out LANGUAGES pSpellLang);
RECERR RECAPIKRN kRecGetUDState | ( | int | sid, |
LPINTBOOL | pChanged | ||
) |
Inquiring whether the user dictionary is changed.
The kRecGetUDState function inquires information about any change in the user dictionary.
[in] | sid | Settings Collection ID. |
[out] | pChanged | Address of a variable to get the modified flag. |
RECERR |
RECERR kRecGetUDState(int sid, out bool pChanged);
RECERR RECAPIKRN kRecGetUserDictionary | ( | int | sid, |
LPTSTR | pFilename, | ||
size_t | iSize1, | ||
LPTSTR | pDefaultSection, | ||
size_t | iSize2 | ||
) |
Getting user dictionary.
The kRecGetUserDictionary function gets the name of the current user dictionary.
[in] | sid | Settings Collection ID. |
[out] | pFilename | Pointer of a buffer to get the name of the current user dictionary. If there is no user dictionary specified, an empty string is returned. |
[in] | iSize1 | Length of the buffer for the name of the user dictionary. |
[out] | pDefaultSection | Deprecated. It must be NULL. |
[in] | iSize2 | Deprecated. It must be 0. |
RECERR |
RECERR kRecGetUserDictionary(int sid, out string pFilename, out string pDefaultSection);
RECERR RECAPIKRN kRecGetVerticalDictionaries | ( | int | sid, |
VDICTDESC * | name, | ||
int | nBuffers, | ||
int * | nNames | ||
) |
Getting vertical dictionaries.
This function gets the names of the current Vertical dictionaries, up to the specified limit. Any enabled vertical dictionaries beyond the specified limit will not be listed.
[in] | sid | Settings Collection ID. |
[out] | name | Array of buffers to store the descriptions of the vertical dictionaries. |
[in] | nBuffers | Number of buffers in name . |
[out] | nNames | Pointer of a variable to store the number of vertical dictionaries. |
RECERR |
RECERR kRecGetVerticalDictionaries(int sid, out string[] names); // or for getting only the number of dictionaries RECERR kRecGetVerticalDictionaries(int sid, out int nNames);
RECERR RECAPIKRN kRecOpenMaintenanceUD | ( | int | sid | ) |
Opening user dictionary for editing.
The kRecOpenMaintenanceUD function opens a user dictionary for editing purposes: to list its contents, to add or delete UDitems, to save the changes.
[in] | sid | Settings Collection ID. |
RECERR |
RECERR kRecOpenMaintenanceUD(int sid);
RECERR RECAPIKRN kRecSaveUD | ( | int | sid, |
LPCTSTR | pFilename, | ||
UDSAVESTYLE | saveStyle | ||
) |
Saving user dictionary.
The kRecSaveUD function saves the user dictionary to a file.
[in] | sid | Settings Collection ID. |
[in] | pFilename | Pointer to the name of the user dictionary file. If it is NULL, the current dictionary name is used as set by a previous call to the kRecSetUserDictionary function. |
[in] | saveStyle | It specifies the saving format of the user dictionary. In the previous version of the Capture SDK this parameter was a INTBOOL type, where the FALSE value was equal to UDSS_INTERNAL, and the TRUE value was equal to UDSS_ORIGINAL. The type UDSAVESTYLE has been created in such a way that a source had used with the previous CSDK requires only a rebuild without any rewriting for the same operation. |
RECERR |
SPL_FOPEN_ERR
. RECERR kRecSaveUD(int sid, string pFilename, UDSAVESTYLE saveStyle);
RECERR RECAPIKRN kRecSetSpell | ( | int | sid, |
INTBOOL | bChksubsystem | ||
) |
Enabling checking module.
The kRecSetSpell function enables or disables the checking module. Its running may improve the overall throughput by marking suspicious words and characters, making it easier to correct them. It can also be set to improve accuracy, by auto-correcting suspicious recognized words.
[in] | sid | Settings Collection ID. |
[in] | bChksubsystem | Flag that indicates whether the checking module is enabled or disabled. |
RECERR |
HPAGE hPage; LANG_ENA pLang[LANG_SIZE]; int sid = 0; // Settings Collection ID . . . for (int i=0; i<LANG_SIZE; i++) { pLang[i] = LANG_DISABLED; } pLang[LANG_GER] = LANG_ENABLED; pLang[LANG_FRE] = LANG_ENABLED; pLang[LANG_ITA] = LANG_ENABLED; rc = kRecSetLanguages(sid, pLang); rc = kRecSetSpell(sid, TRUE); rc = kRecSetSpellLanguage(sid, LANG_GER); rc = kRecSetUserDictionary(sid, NULL, NULL); rc = kRecRecognize(sid, hPage, NULL);
RECERR kRecSetSpell(int sid, bool bChksubsystem);
Setting spell language.
The kRecSetSpellLanguage function specifies the Spelling language for the spell checking of the checking module.
[in] | sid | Settings Collection ID. |
[in] | SpellLang | Identifier of the Spelling language to be set. |
RECERR |
RECERR kRecSetSpellLanguage(int sid, LANGUAGES SpellLang);
RECERR RECAPIKRN kRecSetUserDictionary | ( | int | sid, |
LPCTSTR | pFilename, | ||
LPCTSTR | pDefaultSection | ||
) |
Setting user dictionary.
The kRecSetUserDictionary function specifies a user dictionary for the checking module.
[in] | sid | Settings Collection ID. |
[in] | pFilename | Name of the user dictionary file. If it is NULL, a new and empty user dictionary will be created in memory. |
[in] | pDefaultSection | Deprecated. It must be NULL or empty string. |
RECERR |
RECERR kRecSetUserDictionary(int sid, string pFilename, string pDefaultSection);
Setting vertical dictionaries.
This function specifies vertical dictionaries for the checking module.
[in] | sid | Settings Collection ID. |
[in] | names | The descriptions of the vertical dictionaries to be selected. |
[in] | nNames | The number of vertical dictionaries to be set. |
RECERR |
NULL
pointer in parameter names
, or zero in parameter nNames
, or an empty string as the first name. RECERR kRecSetVerticalDictionaries(int sid, string[] name);