Important: The information in this document is obsolete and should not be used for new development.
Inherits from | |
Package | com.apple.cocoa.foundation |
Companion guide |
The NSSpellServer class gives you a way to make your particular spelling checker a service that’s available to any application. A service is an application that declares its availability in a standard way, so that any other applications that wish to use it can do so. If you build a spelling checker that makes use of the NSSpellServer class and list it as an available service, then users of any application that makes use of NSSpellChecker or includes a Services menu will see your spelling checker as one of the available dictionaries.
spellServerDidForgetWord
delegate method
spellServerDidLearnWord
delegate method
spellServerSuggestCompletionsForPartialWordRange
delegate method
spellServerSuggestGuessesForWord
delegate method
Returns the receiver’s delegate.
public Object delegate
()
Indicates whether word is in the user’s list of learned words or the document’s list of words to ignore.
public boolean isWordInUserDictionaries
(String word, boolean flag)
If true
, the word is acceptable to the user. flag indicates whether the comparison is to be case-sensitive.
Notifies the receiver of a language your spelling checker can check.
public boolean registerLanguage
(String language, String vendor)
language is the English name of a language on Apple’s list of languages. vendor identifies the vendor (to distinguish your spelling checker from those that others may offer for the same language). If your spelling checker supports more than one language, it should invoke this method once for each language. Registering a language-vendor combination causes it to appear in the Spelling Panel’s pop-up list of spelling checkers.
Returns true
if the language is registered, false
if for some reason it can’t be registered.
Causes the receiver to start listening for spell-checking requests.
public void run
()
This method starts a loop that never returns; you need to set the NSSpellServer’s delegate before sending this message.
Assigns a delegate, anObject, to the receiver.
public void setDelegate
(Object anObject)
Because the delegate is where the real work is done, this step is essential before telling the NSSpellServer to run.
Notifies the delegate that sender has removed word from the user’s list of acceptable words in the language, language.
public abstract void spellServerDidForgetWord
(NSSpellServer sender, String word, String language)
If your delegate maintains a similar auxiliary word list, you may wish to edit the list accordingly.
Notifies the delegate that sender has added word to the user’s list of acceptable words in the language, language.
public abstract void spellServerDidLearnWord
(NSSpellServer sender, String word, String language)
If your delegate maintains a similar auxiliary word list, you may wish to edit the list accordingly.
This delegate method returns an array of possible word completions from the spell checker, based off a partially completed string string and a given range range.
public abstract NSArray spellServerSuggestCompletionsForPartialWordRange
(NSSpellServer sender, NSRange range, String string, String language)
See completionsForPartialWordRange
in NSSpellChecker for more information.
Gives the delegate the opportunity to suggest guesses to sender for the correct spelling of the misspelled word, word in the language, language.
public abstract NSArray spellServerSuggestGuessesForWord
(NSSpellServer sender, String word, String language)
Returns the guesses as an array of Strings.
© 1997, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-07-24)