Sentry Spell Checker |
Home Site index Contact us Catalog Shopping Cart Products Support Search |
You are here: Home > Add a spell checker to your applications > UNIX
Sentry Spell Checker provides everything you need to add a full spell check capability to your UNIX/Linux 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 on any flavor of UNIX including Linux and Solaris. Sentry uses only ANSI C language features and C library functions. All I/O is accomplished using the STDIO package. Adding Sentry to your UNIX application is simply a matter of compiling the supplied source code and linking the resulting object files with application.
Click on a topic below to find out more about how Sentry Spell Checker works with your UNIX 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.
See also:
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 any number of 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 © 2015 Wintertree Software Inc.