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 /


SpellLearn

SpellLearn(speller, word)

Adds a word to the user's personal word list.

speller
The frame returned by the *SpellDocBegin function.

word
A string containing a word to add to the word list.

return value
Returns the word that was learned, so that you can pass it to *SpellUnlearn for implementing undo behavior. The value nil is returned if the word was not added to the personal word list because the list is full or some other error occurred.

DISCUSSION

SpellLearn processes the word as described in "Processing of Words Passed to the Spell Checker". It then adds the word to the personal word list. This will cause the word to be recognized as a correctly spelled word in subsequent spell-check sessions.

When you pass this function an unknown capitalized word, or one that is all uppercase letters, then SpellLearn displays a slip asking the user to confirm that the word should be stored capitalized (or all uppercase). If the user taps Yes, the word is stored as written. If the user taps No, the word is converted to lowercase before being stored.

This notification slip can be disabled by setting the speller frame slot dialogInhibit to a non-nil value before calling SpellLearn. In this case, SpellLearn stores the word exactly as it is passed to it.

The personal word list has a limit of 1000 words. Once this limit is reached, SpellLearn won't store any more words and instead displays a notification slip telling the user that the list is full and asking if they want to open the personal word list in order to remove some words. The user can tap Yes to open the word list. You can disable the display of this notification slip by setting the speller frame slot dialogInhibit to a non-nil value before calling SpellLearn. In this case, SpellLearn simply returns nil if the list is full.


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