LMD-Tools SpellPack Guide


Overview


LMD SpellPack provides basic spell checking abilities utilizing publicly available Open Office dictionaries. Spell checking functionality is provided via built-in live spelling feature of some LMD text editing controls and standard edit/memo controls (beta). As well, public API interface is available for custom use cases.

 

The package is available for Delphi XE2 or later IDE version.

 

clip0003

 

clip0005

 

clip0007

 

Features

 

Following is a short list of LMD SpellPack features:

 

Basic spell checking features accessible via TLMDSpellChecker component public methods and properties, such as word spelling check, suggestions, analyzing and hyphenation (API only).

oSpell

oSuggest

oAnalyze

oStem

oHyphenate

Live spell feature built into TLMDEdit, TLMDMemo, TLMDEditView (syntax edit) LMD controls, and TEdit, TMemo standard Delphi controls (beta), which provides visual real-time spell errors highlighting, suggestion list in edit's context menu (only LMD controls for now):

oIncludes Spelling property for LMD controls, with some spell related settings.

oIncludes EnableControl, DisableControl methods for turning spell checking on or off in standard edit control, along with TryGetSettings method for getting access to control's spell related properties. Support for global single spell checker via Global and EnableControl static methods.

oSupport for spell errors across wrapped line boundaries in TLMDMemo.

oSupport of Unicode Complex Scripts character positioning in TLMDEditView (syntax edit).

oSupport of spell errors filtering by token in TLMDEditView (syntax edit).

Utilizing of publicly available OXT dictionary files.

Multiple active directories with adaptive directories re-ordering while spell checking for performance optimization.

Configuration of TLMDSpellChecker dictionary files and active dictionaries via TLMDSpellConfigDialog dialog component.

oMultiple OXT dictionary files can be active; multiple dictionaries can be active.

oAvailable also at design-time as a TLMDSpellChecker component editor.

oSaving/Loading configuration into abstract stream, file (INI file format) or registry via TLMDSpellChecker overloaded methods:

SaveConfig

LoadConfig

Full spell checking of a text document or a form with several text controls via TLMDSpellScanDialog component:

oAsynchronous event driven mode API for custom UI.

oMultiple controls support - a form with several text edits and/or memos.

oFree user actions - user can move edit caret by mouse or keyboard; move focus between controls; edit text, ect.

oSuggest, Skip (without errors hiding) and Replace functionality.

oDelay for smoother text editing.

 

NHunspell Dlls

 

LMD SpellPack controls are wrappers on NHunspell DLLs by Thomas Maierhofer licensed under GNU Lesser General Public License (LGPLv3):

 

https://www.codeproject.com/Articles/33658/NHunspell-Hunspell-for-the-NET-platform

https://opensource.org/licenses/lgpl-3.0.html

 

One of the following two dlls, depending of platform, should be accessible to application at run-time:

 

Hunspellx86.dll

Hunspellx64.dll

 

Dlls are provided as part of LMD SpellPack installation. To be usable by an application, dlls should be either copied to application's exe folder. Another option is to add dlls path to PATH environment variable.

 

Dictionaries

 

LMD SpellPack supports *.oxt dictionary file format. The file is actually a zip file, which contain several dictionaries along with required meta-data. Basic English dictionary file is included as part of LMD SpellPack installation: dict-en.oxt. More dictionary files can be downloaded from here:

 

https://extensions.openoffice.org/en/search?f%5B0%5D=field_project_tags%3A157

 

As described here, application should provide access to dictionary files, which will be used by end users to configure spell checking.