AddWordToCacheDictionary Method of the FRPage Object
This method adds one word to the cache dictionary. The cache dictionary is a small dictionary (about a hundred words) which can be changed easily during processing. The cache dictionaries can be used when it is possible to select a dictionary more precisely, if you found new information about the document during processing.
If the word you are adding already exists in the dictionary, no duplicate will be created, but the weight of this word will be equal to the maximum of the weight specified in dictionary and the weight you pass in call to this method.
Important! To use the cache dictionary, you should set the IEngine::AutoCleanRecognizerSession property to FALSE. The AutoCleanRecognizerSession property is set to TRUE by default, which means that FineReader Engine cleans its recognition session after recognition of each page, in which case the cache dictionary is cleaned too. To prevent accidental destruction of user data, FineReader Engine prohibits using of cache dictionaries in this mode. If you use the cache dictionary, it is your concern to clean recognition session manually by calling IEngine::CleanRecognizerSession method when necessary. See the description of the method to find out when it is necessary to clean recognition session.
HRESULT AddWordToCacheDictionary( IRecognizerParams* params, BSTR Word, int Weight );
void AddWordToCacheDictionary( IRecognizerParams params, string Word, int Weight );
Visual Basic .NET
Sub AddWordToCacheDictionary( _ params As IRecognizerParams, _ Word As String, _ [Weight As Integer = 100] _ )
- [in] The RecognizerParams object that stores parameters of page processing.
- [in] This parameter contains the newly added word.
- [in] The weight assigned to the word in the dictionary. Must be in the range from 1 to 100. The higher the weight for a word is, the more likely this word will be taken as a variant during recognition. The normal value for this parameter is 100, this value is used by default. The weight assigned to the word in the dictionary may have a set of discrete values only. The value passed in this parameter is rounded to the nearest of the discrete set of values.
This method has no specific return values. It returns the standard return values of ABBYY FineReader Engine functions.
For adding a group of words to the cache dictionary, use the AddWordsToCacheDictionary method instead.