Error processing SSI file
LEADTOOLS OCR (Leadtools.Forms.Ocr assembly)

Show in webframe

AddUserWords Method








The language name. For more information about the format of language names, refer to IOcrLanguageManager.
Array of words to add.
Adds user words to a language dictionary.
Syntax
void AddUserWords( 
   string language,
   string[] words
)
'Declaration
 
Sub AddUserWords( _
   ByVal language As String, _
   ByVal words() As String _
) 
'Usage
 
Dim instance As IOcrSpellCheckManager
Dim language As String
Dim words() As String
 
instance.AddUserWords(language, words)
void AddUserWords( 
   string language,
   string[] words
)
- (void)addUserWords:(LTOcrLanguage)language
               words:(NSArray<NSString *> *)words
               error:(NSError **)error
            
public void addUserWords(String language,
                         ArrayList<String> words)
            
function Leadtools.Forms.Ocr.IOcrSpellCheckManager.AddUserWords( 
   language ,
   words 
)
void AddUserWords( 
   String^ language,
   array<String^>^ words
) 

Parameters

language
The language name. For more information about the format of language names, refer to IOcrLanguageManager.
words
Array of words to add.
Remarks

Only supported by the LEADTOOLS OCR Advantage engine.

Use this method to add user words to the current loaded dictionary. Note that the OCR engine does not automatically correct the misspelling of words unless the confidence of the characters are low.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Forms
Imports Leadtools.Forms.Ocr
Imports Leadtools.Drawing

Public Sub AddUserWordsExample()
   ' Create an instance of the engine
   Using ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, False)
      ' Start the engine using default parameters
      ocrEngine.Startup(Nothing, Nothing, Nothing, LEAD_VARS.OcrAdvantageRuntimeDir)
      Dim spellCheckManager As IOcrSpellCheckManager = ocrEngine.SpellCheckManager

      ' Add the following words to the English dictionary
      Dim newWord() As String = {"OMRing", "Binarization"}
      spellCheckManager.AddUserWords("en", newWord)

      ' Now perform other OCR functions here

      ' Shutdown the engine
      ' Note: calling Dispose will also automatically shutdown the engine if it has been started
      ocrEngine.Shutdown()
   End Using
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Forms.Ocr;
using Leadtools.Drawing;

public void AddUserWordsExample()
{
   // Create an instance of the engine
   using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false))
   {
      // Start the engine using default parameters
      ocrEngine.Startup(null, null, null, LEAD_VARS.OcrAdvantageRuntimeDir);
      IOcrSpellCheckManager spellCheckManager = ocrEngine.SpellCheckManager;

      // Add the following words to the English dictionary
      string[] newWord = { "OMRing", "Binarization" };
      spellCheckManager.AddUserWords("en", newWord);

      // Now perform other OCR functions here

      // Shutdown the engine
      // Note: calling Dispose will also automatically shutdown the engine if it has been started
      ocrEngine.Shutdown();
   }
}
Requirements

Target Platforms

See Also

Reference

IOcrSpellCheckManager Interface
IOcrSpellCheckManager Members

Error processing SSI file
Leadtools.Forms.Ocr requires a Recognition or Document Imaging Suite license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features