Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 5 - Spell Checker / Spell Checker Reference
Functions /


SpellCheck

SpellCheck(speller, word)

Checks the spelling of a word.

speller
The frame returned by the *SpellDocBegin function.

word
A string containing a word to spell check.

return value
A nil value indicates that the word or number is correct. A non-nil value indicates that the word may need to be corrected.

DISCUSSION

This function first processes the word as described in "Processing of Words Passed to the Spell Checker". It then looks to see if the word is in one of the dictionaries or word lists. If so, *SpellCheck returns nil. If the word is not in a dictionary, or if its capitalization is not correct, then *SpellCheck returns non-nil.

Here are some examples:

SpellCheck(s, "and") => nil // word is spelled correctly

SpellCheck(s, "And") => nil // word is spelled correctly SpellCheck(s, "AND") => nil // word is spelled correctly SpellCheck(s, "ernie") => non-nil // capitalization is wrong SpellCheck(s, "Ernie") => nil // word is spelled correctly SpellCheck(s, "ERNIE") => nil // word is spelled correctly SpellCheck(s, "irs") => non-nil // word needs all caps SpellCheck(s, "Irs") => non-nil // word needs all caps SpellCheck(s, "IRS") => nil // word is spelled correctly SpellCheck(s, "(and.)") => nil // word is spelled correctly SpellCheck(s, "(bxnd.)") => non-nil // word is not spelled correctly SpellCheck(s, "isn't") => nil // word is spelled correctly SpellCheck(s, "isn't") => nil // word is spelled correctly SpellCheck(s, "so-so") => non-nil // word is not spelled correctly SpellCheck(s, "ab#de") => non-nil // word is not spelled correctly SpellCheck(s, "so") => nil // word is spelled correctly


Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help