Sets the User dictionary and its default section to be used by the checking subsystem.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As RasterDocumentEngine
Dim userDictionaryName As String
Dim userDefaultSectionName As String
Dim createUserDictionary As Boolean
instance.SetUserDictionary(userDictionaryName, userDefaultSectionName, createUserDictionary)
|
Parameters
- userDictionaryName
- The user's dictionary file name.
- userDefaultSectionName
- The name of the default section in the user's dictionary.
- createUserDictionary
-
Flag to determine method behavior. Possible values are:
- true: Create a new user dictionary in memory
- false: Save the current user dictionary to the file indicated in the DictionaryFileName property and DictionaryDefaultSection property.
Example
Visual Basic | Copy Code |
---|
Public Sub SetUserDictionaryExample()
RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")
Dim rasterDocument As RasterDocumentEngine
rasterDocument = RasterDocumentEngine.Instance
rasterDocument.Startup()
rasterDocument.SetUserDictionary("USERDIC1.DIC", "cities", True)
Dim item As RasterDocumentUserDictionaryItem = RasterDocumentUserDictionaryItem.Empty
item.Value = "Peabody"
item.Attribute = RasterDocumentDictionaryAttribute.Literal
rasterDocument.AddItemToUserDictionary("cities", item)
item.Value = "Budapest"
item.Attribute = RasterDocumentDictionaryAttribute.Literal
rasterDocument.AddItemToUserDictionary("cities", item)
rasterDocument.SetUserDictionary("USERDIC1.DIC", "cities", False)
rasterDocument.Shutdown()
End Sub |
C# | Copy Code |
---|
public void SetUserDictionaryExample() { // Note that this is a sample key, which will not work in your toolkit RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey"); RasterDocumentEngine rasterDocument; rasterDocument = RasterDocumentEngine.Instance; rasterDocument.Startup(); rasterDocument.SetUserDictionary("USERDIC1.DIC", "cities", true); RasterDocumentUserDictionaryItem item = RasterDocumentUserDictionaryItem.Empty; item.Value = "Peabody"; item.Attribute = RasterDocumentDictionaryAttribute.Literal; rasterDocument.AddItemToUserDictionary("cities", item); item.Value = "Budapest"; item.Attribute = RasterDocumentDictionaryAttribute.Literal; rasterDocument.AddItemToUserDictionary("cities", item); rasterDocument.SetUserDictionary("USERDIC1.DIC", "cities", false); rasterDocument.Shutdown(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also