Skip to content


TSynSpellCheck Help

Donate!

  • Download TSynSpellCheck
  • TSynSpellCheck History
  •  Properties

    Algorithms (HashAlgorithms) Specifies what algorithm is to be used for searching for word suggestions. Does not work yet. The metaphon unit is included but the class has not yet been finished.

    CheckAttribs (TStringList) Specifies what tokens should be spell checked. Default values should work fine for most highlighters.

    Editor (TCustomSynEdit) The editor that TSynSpellCheck will spell check.

    Modified (Boolean) Set to True if the user has added or deleted words, else the value is False. You can use this to determine if you want to save the user’s dictionary list.

    Name (string) Component name.

    OpenDictionary (Boolean) Read Only. True if a dictionary is open, else it is False.

    Options (TSynSpellCheckOptions) Options of the component.sscoAutoSpellCheck – Automatically spell checks the contents of the editor and underlines all unknown words.

    sscoHideCursor – When this option is set to True the cursor changes from default to crHourGlass. When the spell check finishes the cursor is restored to original cursor.
    sscoHourGlass – Changes cursor to crHourGlass when searching for unknown words. Saves and reverts to old cursor when a unknown word is found or search is finished.
    sscoIgnoreWordsWithNumbers – Ignores any words containing numbers.
    sscoStartFromCursor – Starts spell checking from current cursor position.
    sscoSuggestWords – Suggests word spellings when an unknown word is found.

    PenColor (TColor) Specifies the color of the underline for unknown words.

    SkipList (TStringList) used during spell check. It contains the words that the user decided to ignore. This list is temporary. Adding words permanently to this has no sense. That’s the task of the dictionary.

    SoundexLength (TSoundexLength) Specifies the length of Soudnex hashes. The longer the more accurate the suggestions may be, but the less there will be.

    UnderlineStyle (TUnderlineStyle) Specifies the type of underline to use when underlining unknown words.

    usMicrosoftWord offers Microsoft Word style underlining.
    usCorelWordPerfect mimics Corel Word Perfect.

    Events

    OnAbort (TNotifyEvent) Occurs when the use aborts the spell checking process.

    OnAddWord (TNotifyEvent) Occurs when the user adds a word to the user dictionary.

     

    OnCheckWord procedure(Sender: TObject; AWord: string; ASuggestions: TStringList; var ACorrectWord: string; var AAction: Integer)
    Occurs when an unknown word is found. AWord contains the word, ASuggestions contains a list of word suggestions (only if sscoSuggestWords is set in Options). ACorrectWord is the corrected word. This value is set by the user. AAction specifies what action is to be taken. Valid actions are:

    ACTION_ABORT – Aborts spell check. Calls OnAbort event.
    ACTION_SKIP – Skips current word.
    ACTION_SKIPALL – Adds word to SkipList and skips all further occurences of word.
    ACTION_CORRECT – Replaces word with ACorrectWord in editor.
    ACTION_ADD – Adds the word to the user’s dictionary.

    OnCorrectWord procedure (Sender: TObject; AWord, ACorrectWord: string)
    Occurs when a word has been corrected. This is only for informational purposes. See OnCheckWord

    OnDictClose (TNotifyEvent) Occurs after the dictionary is closed.

    OnDictLoad (TNotifyEvent) Occurs after the dictionary is loaded.

    OnDone (TNotifyEvent) Occurs when the spell checking process is finished.

    OnSkipWord (TOnSkipWord) Occurs when a word is either skipped or ignored.

    OnStart (TNotifyEvent) Occurs immediately before the spell checking is to begin.

    Routines

    AddDictWord procedure (Word: string) Adds word to user dictionary.

    AddDictWordList procedure (WordList: TStringList) Same as AddDictWord(), but take a TStringList as the parameter.AddEditor function (AEditor: TCustomSynEdit): Integer;
    Adds an editor to spell checking (auto spell checking too) and returns it’s index in Editor list.

    AddSkipWordList procedure (WordList: TStringList);
    Same as AddSkipWord(), but take a TStringList as the parameter.

    CheckWord function (Word: string): Boolean;
    Checks if the word is a dictionary word.

    ClearDictWords procedure Clears current dictionary word list. Memory only, dictionary file remains untouched.

    DeleteDictWord procedure (Word: string) Deletes word from dictionary word list. If the word is in the dictionary file the change is not permanent. If the word was a user added word it will be permanently deleted upon saving the user dictionary.

    DeleteSkipWord procedure (Word: string) Deletes word from user skip list.
    DictionaryExists function (Language: string; Path: string): Boolean Checks if a dictionary for the specified language is present. If no path is specified the shared dictionary folder (%ProgramFiles%\Common Files\SynSpell\) is searched.
    FixLists procedure Converts all words in SkipList to lowercase to ensure proper word checking. The lists are case-sensitive and all functions accept lowercase parameters only.
    GetDictionaryList procedure (var tslList: TStringList) Returns all currently installed dictionary files in %ProgramFiles%\Common Files\SynSpell\.
    GetNewestDictionary function (Language: string): string; Returns the full file path to the newest dictionary for the specified language.
    GetWordCount function :Integer Returns the number of words in the dictionary.
    IsDictWord function (Word: string): Boolean Checks if the word is present in the current dictionary. Same as CheckWord().
    IsSkipWord function (Word: string): Boolean Checks if the word is present in the skip list.
    LoadDictionary procedure (Language: string; FileName: string) Loads words from dictionary. If FileName is set to ” then the most recent dictionary for the specified Language is used. It must be then installed in the %ProgramFiles%\Common Files\SynSpell\ directory. If you want to use your own word list you must use FileName.Using Language and the %ProgramFiles%\Common Files\SynSpell\ directory makes most sense. Dictionaries are shared amongst programs and the user one dictionary is used.To use more than one dictionary just call this function with each word list file you wish to use. Example:SynSpellCheck1.LoadDictionary(ExtractFilePath(Application.ExeName) + ‘Dictionary\cars.dic’);
    SynSpellCheck1.LoadDictionary(“english”);This will load the most recent shared dictionary for the English language plus add words from the cars.dic file. Be careful what you call first. The last called should be a standard language file, since the user dictionary will be saved in the last opened dictionary folder.
    LoadSkipList procedure (FileName: string) Loads SkipList wordlist from file.
    RemoveEditor function (AEditor: TCustomSynEdit): Boolean; Removes the specified editor from the editor list. Returns true if successful and false if an error occurs.
    SaveSkipList procedure (FileName: string) Saves SkipList wordlist to file.
    SaveUserDictionary procedure Saves the user’s dictionary. It is saved in the same folder as the dictionary used. If no dictionary was used then the word list will be saved in the current directory. The user dictionary is saved in the folder where the dictionary file is located.
    SpellCheck procedure Spell checks the Editor specified in the Editor property.

    0 Responses

    Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



    Some HTML is OK

    or, reply to this post via trackback.