OcrSpellCheckEngine Enumeration (original) (raw)
Summary
OCR Spell Checker Type
Syntax
C#
Objective-C
C++/CLI
Java
Python
public enum OcrSpellCheckEngine
typedef NS_ENUM(NSInteger, LTOcrSpellCheckEngine) {
LTOcrSpellCheckEngineNone = 0,
LTOcrSpellCheckEngineNative
};
public enum OcrSpellCheckEngine
public enum class OcrSpellCheckEngine
class OcrSpellCheckEngine(Enum):
None = 0
Native = 1
OS = 2
Hunspell = 3
Members
Value | Member | Description |
---|---|---|
0 | None | No spell checker (disables the spell check sub system) |
1 | Native | Native engine spell checker. |
2 | OS | The operating system spell checker. |
3 | Hunspell | Hunspell spell checker. |
Example
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms.Common;
using Leadtools.Ocr;
using Leadtools.Drawing;
public void OcrSpellCheckManagerExample()
{
// Create an instance of the engine
using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD))
{
// Start the engine using default parameters
ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir);
IOcrSpellCheckManager spellCheckManager = ocrEngine.SpellCheckManager;
// Get the spell language supported (languages with a dictionary)
string[] spellLanguages = spellCheckManager.GetSupportedSpellLanguages();
foreach (string spellLanguage in spellLanguages)
Console.WriteLine(spellLanguage);
// Check if English is supported
string language = "en";
if (spellCheckManager.IsSpellLanguageSupported(language))
{
// Yes, set it
spellCheckManager.SpellLanguage = language;
Console.WriteLine("Current spell language: {0}", spellCheckManager.SpellLanguage);
}
// Enable the spell checking system
spellCheckManager.SpellCheckEngine = OcrSpellCheckEngine.Native;
// 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();
}
}
static class LEAD_VARS
{
public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS22\Bin\Common\OcrLEADRuntime";
}