Sentry Spell Checker
You are here: Home > Add a spell checker to your applications > Macintosh
Sentry Spell Checker provides everything you need to add a full spell check capability to your Macintosh applications written in C or C++. Click here to find out more about Sentry Spell Checker.
Sentry is available as portable ANSI C source code which is compilable using any Macintosh ANSI C compiler. Sentry uses only ANSI C language features and C library functions. All I/O is accomplished using the STDIO package. Adding Sentry to your Macintosh application is simply a matter of compiling the supplied source code and linking the resulting object files with your applications.
Click on a topic below to find out more about how Sentry Spell Checker works with your Macintosh applications:
It's easy to spell check a string containing one word or thousands of words with Sentry. If you know the string contains a single word, you can pass it to Sentry's CheckWord function. CheckWord checks the word against all open dictionaries and returns a flag indicating whether the word is correctly spelled or not.
If the string may contain multiple words, your application can open a text block and call the CheckString function. CheckString checks each word in the string and returns to your application when it encounters a misspelling. Normally your application would call CheckString in a loop which terminates when CheckString indicates that all words have been checked. When CheckString reports a misspelling, your application can easily obtain the offending word and its position within the string.
When Sentry detects a misspelled word, you may want to present suggested alternatives for the user to select. This is easily done using the Suggest function. The Suggest function fills an application-supplied buffer with suggested replacements for a misspelled word. The words are provided in order of decreasing score: The first word is the most likely correct replacement.
The Suggest function can search for suggested replacements using two approaches: phonetic and typographical. Phonetic suggestions are based on words which sound like the misspelled word (using English pronunciation rules). Typographical suggestions are based on how closely the letters in the suggested word match the letters in the misspelled word. The Suggest function uses either or both approaches based on option settings.
Some words reported as misspellings may by valid words which are not in Sentry's dictionary. These words may include technical terms or proper names, such as the user's family name. Sentry allows an application to add words to user dictionaries so the words will not subsequently be reported as misspellings.
Words are added to user dictionaries using the AddToLex function. Dictionaries may be persistent (i.e., disk based) or temporary, meaning they disappear when closed or when the application terminates. User dictionaries can also store an action code which is associated with each word. The action codes tell Sentry what to do when the word is encountered:
Ignore (skip) the word because it is correctly spelled
Copyright © 1999 Wintertree Software Inc. Last modified