Adds user words to a language dictionary.
- (void)addUserWords:(LTOcrLanguage)languagewords:(NSArray<NSString *> *)wordserror:(NSError **)error
function Leadtools.Forms.Ocr.IOcrSpellCheckManager.AddUserWords(language ,words)
language
The language name. For more information about the format of language names, refer to IOcrLanguageManager.
words
Array of words to add.
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.
using Leadtools;using Leadtools.Codecs;using Leadtools.Forms;using Leadtools.Forms.Ocr;using Leadtools.Drawing;public void AddUserWordsExample(){// Create an instance of the engineusing (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false)){// Start the engine using default parametersocrEngine.Startup(null, null, null, LEAD_VARS.OcrAdvantageRuntimeDir);IOcrSpellCheckManager spellCheckManager = ocrEngine.SpellCheckManager;// Add the following words to the English dictionarystring[] 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 startedocrEngine.Shutdown();}}static class LEAD_VARS{public const string OcrAdvantageRuntimeDir = @"C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.FormsImports Leadtools.Forms.OcrImports Leadtools.DrawingPublic Sub AddUserWordsExample()' Create an instance of the engineUsing ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, False)' Start the engine using default parametersocrEngine.Startup(Nothing, Nothing, Nothing, LEAD_VARS.OcrAdvantageRuntimeDir)Dim spellCheckManager As IOcrSpellCheckManager = ocrEngine.SpellCheckManager' Add the following words to the English dictionaryDim 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 startedocrEngine.Shutdown()End UsingEnd SubPublic NotInheritable Class LEAD_VARSPublic Const OcrAdvantageRuntimeDir As String = "C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime"End Class
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
