Class THunSpell

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type THunSpell = class(TComponent)

Description

Component wrapper for the Hunspell library <http://hunspell.sourceforge.net/>.

Hierarchy

Overview

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function Spell(const AWord: string): boolean;
Public function Suggest(const AWord: string; AStrings: TStrings): integer;
Public function Ignore(const AWord: string): boolean;
Public function Add(const AWord: string): boolean;
Public function GetDicts(AList: TStrings): integer;
Public class function SearchDicts(const ADir: string; AList: TStrings): integer;

Properties

Public property Codepage: Word read fCodePage;
Published property CustomDic: boolean read fCustomDic write SetCustomDic;
Public property CustomDistName: string read GetCustomDictName;
Published property Dict: string read fDict write SetDict;
Published property DictDir: string read fDictDir write SetDictDir;
Public property DictEncoding: string read GetDictEncoding;
Published property Enabled: boolean read fEnabled write SetEnabled default true;
Published property IgnoreAllCaps: boolean read fIgnoreAllCaps write fIgnoreAllCaps;
Published property IgnoreWordsWithNumbers: boolean read fIgnoreWordsWithNumbers write fIgnoreWordsWithNumbers;
Public property Initialized: boolean read GetInitialized;
Published property OnInit: TNotifyEvent read fOnInit write fOnInit;
Published property OnUninit: TNotifyEvent read fOnUninit write fOnUninit;

Description

Methods

Public constructor Create(AOwner: TComponent); override;

Public declarations

Public destructor Destroy; override;
 
Public function Spell(const AWord: string): boolean;

Check a word

Parameters
AWord
The word to check.
Returns

True if it's properly spelled.

Public function Suggest(const AWord: string; AStrings: TStrings): integer;

Get suggestions for a not found word.

Parameters
AWord
The word
AString
This List is filled with the suggestions.
Returns

Count of suggestions.

Public function Ignore(const AWord: string): boolean;

Ignore all occurrences of the word.

Parameters
AWord
The word to ignore.
Returns

True when the word was added.

Public function Add(const AWord: string): boolean;

If CustomDic = True the word is added to custom.dic, otherwise it is the same as Ignore.

Parameters
AWord
The word to ignore.
Returns

True when the word was added.

Public function GetDicts(AList: TStrings): integer;

Get all dictionaries in the dictionaries directory (DictDir).

Parameters
AList
The list to fill with the dictionaries.
Returns

Count of found dictionaries.

Public class function SearchDicts(const ADir: string; AList: TStrings): integer;

Search given directory for dictionaries.

Parameters
ADir
The directory to look for dictionaries.
AList
List with filled dictionaries.
Returns

The count of found dictionaries.

Properties

Public property Codepage: Word read fCodePage;

Return codepage of loaded dictionary.

Published property CustomDic: boolean read fCustomDic write SetCustomDic;

En-/Disable custom dictionary. Added words are saved to dict\custom.dic

Public property CustomDistName: string read GetCustomDictName;

Full filename of the custom dictionary.

Published property Dict: string read fDict write SetDict;

Filename of dictionary to use without the extension (.dic, .aff), e.g. en_US

Published property DictDir: string read fDictDir write SetDictDir;

Directory where the dictionary is located. If CustomDic = True then the program should have write permissions for this directory, because custom.dic is saved to it.

Public property DictEncoding: string read GetDictEncoding;

Return the encoding of the loaded dictionary.

Published property Enabled: boolean read fEnabled write SetEnabled default true;

En/-disable spell checking.

Published property IgnoreAllCaps: boolean read fIgnoreAllCaps write fIgnoreAllCaps;

Ignore words with all capital letters, e.g. acronyms.

Published property IgnoreWordsWithNumbers: boolean read fIgnoreWordsWithNumbers write fIgnoreWordsWithNumbers;

Ignore words containing numbers.

Public property Initialized: boolean read GetInitialized;

Returns True when the spell checker is ready to use.

Published property OnInit: TNotifyEvent read fOnInit write fOnInit;

Hunspell was initialized.

Published property OnUninit: TNotifyEvent read fOnUninit write fOnUninit;

Hunspell was uninitialized.


Generated by PasDoc 0.12.0 on 2011-01-24 07:59:29