Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

NSSpellCheckerMBS.availableLanguages as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.7 Yes No No Yes, macOS only No
Function: Returns a list of the available languages.
Notes: Requires Mac OS X 10.5.

Feedback, Comments & Corrections

NSSpellCheckerMBS.checkGrammarOfString(text as string, start as Integer, language as string, wrap as boolean) as NSRangeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Initiates a grammatical analysis of a given string.
Notes:
text: String to analyze.
start: Location within string at which to start the analysis.
language: Language use in string. When nil, the language selected in the Spelling panel is used.
wrap: true to specify that the analysis continue to the beginning of string when the end is reached. false to have the analysis stop at the end of string.
outDetails: Optional. On output, dictionaries describing grammar-analysis details within the flagged grammatical unit. See the NSSpellServer class for information about these dictionaries.

Returns Location of the first flagged grammatical unit.

Available in Mac OS X v10.5 and later.

See also:

Feedback, Comments & Corrections

NSSpellCheckerMBS.checkGrammarOfString(text as string, start as Integer, language as string, wrap as boolean, Details() as dictionary) as NSRangeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Initiates a grammatical analysis of a given string.
Notes:
text: String to analyze.
start: Location within string at which to start the analysis.
language: Language use in string. When nil, the language selected in the Spelling panel is used.
wrap: true to specify that the analysis continue to the beginning of string when the end is reached. false to have the analysis stop at the end of string.
outDetails: Optional. On output, dictionaries describing grammar-analysis details within the flagged grammatical unit. See the NSSpellServer class for information about these dictionaries.

Returns Location of the first flagged grammatical unit.

Available in Mac OS X v10.5 and later.

See also:

Feedback, Comments & Corrections

NSSpellCheckerMBS.checkSpellingOfString(text as string, start as Integer) as NSRangeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Initiates a spell-check of a string.
Notes: Returns the range of the first misspelled word.

See also:

Feedback, Comments & Corrections

NSSpellCheckerMBS.checkSpellingOfString(text as string, start as Integer, language as string, wrap as boolean) as NSRangeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Initiates a spell-check of a string.
Notes: Returns the range of the first misspelled word.

See also:

Feedback, Comments & Corrections

NSSpellCheckerMBS.checkSpellingOfString(text as string, start as Integer, language as string, wrap as boolean, byref WordCount as Integer) as NSRangeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Initiates a spell-check of a string.
Notes: Returns the range of the first misspelled word (and optionally the wordCount by reference).

See also:

Feedback, Comments & Corrections

NSSpellCheckerMBS.completionsForPartialWordRange(start as Integer, length as Integer, text as string, language as string="") as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Searches possible completions for the given word.
Notes:
Returns an array of strings, in the order in which they should be presented, representing complete words that the user might be trying to type when starting by typing the partial word at the given range in the given string.

Within the text, length characters are picked starting at at position (0 based) and matched agains the dictionary defined by language.
Up to around 100 words are returned.

Requires Mac OS X 10.3.
Returns an empty string on any error.

Feedback, Comments & Corrections

NSSpellCheckerMBS.countWordsInString(word as string, language as string="") as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Just counts the words without checking spelling.
Example:
dim text as string = "Hello World"
dim spell as NSSpellCheckerMBS // your spellchecker

msgBox str(spell.countWordsInString(text,"en"))
Notes:
Returns the number of words in text. The language argument specifies the language used in the string. If language is the empty string, the current selection in the Spelling panel's pop-up menu is used.

Returns -1 if text is nil or this spellchecker function is not available.

Returns -1 if counting words isn't supported by the spell server selected.

Feedback, Comments & Corrections

NSSpellCheckerMBS.forgetWord(word as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Removes the given word from the user dictionary.

Feedback, Comments & Corrections

NSSpellCheckerMBS.guessesForWord(range as NSRangeMBS, word as string, language as string) as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Returns an array of possible substitutions for the specified string.
Notes:
range: The range of the string to check.
word: The string to guess
language: The language of the string

Returns an array of strings containing possible replacement words.
Available in Mac OS X v10.6 and later.

See also:

Feedback, Comments & Corrections

NSSpellCheckerMBS.guessesForWord(word as string) as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Returns an array with words matching the given word.
Example:
dim a() as string
dim s as new NSSpellCheckerMBS
a=s.guessesForWord("Hell")

msgbox str(ubound(a)+1)+" suggestions."
Notes:
Returns nil on any error.

Returns an array of suggested spellings for the misspelled word word. If word contains all capital letters, or its first letter is capitalized, the suggested words are capitalized in the same way.

See also:

Feedback, Comments & Corrections

NSSpellCheckerMBS.hasLearnedWord(word as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.7 Yes No No Yes, macOS only No
Function: Checks whether a word has been learned.
Notes:
Returns true if the word is known.
Requires Mac OS X 10.5.

Feedback, Comments & Corrections

NSSpellCheckerMBS.ignoredWords as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: The list of ignored words.
Example:
dim spell as new NSSpellCheckerMBS
dim f as FolderItem
dim i,c as Integer
dim t as TextOutputStream
dim n(-1) as string

f=SpecialFolder.Preferences.Child("SpellCheck RB.pref")
t=f.CreateTextFile
if t<>nil and spell<>nil then
n=spell.ignoredWords
MsgBox Join(n,EndOfLine)
end if
Notes: Returns nil on any error.

Feedback, Comments & Corrections

NSSpellCheckerMBS.ignoreWord(word as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Adds the word to the ignore list so it will be ignored for spell checking in this NSSpellCheckerMBS object.
Notes: Requires Mac OS X 10.2.

Feedback, Comments & Corrections

NSSpellCheckerMBS.languageMenuEntries as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: The entries from the language menu of the panel.
Notes:
Copies the list of menu entries from the panel.

Currently you can use this names to show to the user and see what languages are available. It uses a private property which works for Mac OS X 10.4 and 10.5.
For the language function you need the short names:

Australian Englishen_AU
British Englishen_GB
Canadian Englishen_CA
Deutschde
Englishen
Españoles
Françaisfr
Italianoit
MultilingualMultilingual
Nederlandsnl
Portuguêspt
Protuguês do Brasilpt_BR
Svenskasv

Feedback, Comments & Corrections

NSSpellCheckerMBS.learnWord(word as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.7 Yes No No Yes, macOS only No
Function: Learns the given word.
Notes: Requires Mac OS X 10.5.

Feedback, Comments & Corrections

NSSpellCheckerMBS.setIgnoredWords(words() as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Sets the ignored word list.
Example:
dim spell as NSSpellCheckerMBS // your spellchecker

dim f as FolderItem
dim t as TextInputStream
dim words(-1),line as string

f=SpecialFolder.Preferences.Child("SpellCheck RB.pref")
t=f.OpenAsTextFile
if t<>nil and spell<>nil then

while not t.eof
line=t.ReadLine(encodings.UTF8)
if line<>"" then
words.Append line
end if
wend

spell.setIgnoredWords words

end if

Feedback, Comments & Corrections

NSSpellCheckerMBS.setLanguage(language as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Allows programmatic setting of the language to spell-check in.
Notes:
Normally chosen by a pop-up-list in the spelling panel and defaulted to the user's preferred language, so call this with care.
Set to "" to use the language from the panel popup menu.

Feedback, Comments & Corrections

NSSpellCheckerMBS.spellingPanel as NSPanelMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: The spelling panel used for spell checking.

Feedback, Comments & Corrections

NSSpellCheckerMBS.unlearnWord(word as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Tells the spell checker to unlearn a given word.
Notes:
Available in Mac OS X v10.5 and later.
Same as the older forgetWord.

Feedback, Comments & Corrections

NSSpellCheckerMBS.updatePanels
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Updates the available panels to account for user changes.
Notes:
This method should be called when a client changes some relevant setting, such as what kind of spelling, grammar checking, or substitutions it uses.

Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSSpellCheckerMBS.updateSpellingPanelWithGrammarString(lang as string, detail as dictionary)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Specifies a grammar-analysis detail to highlight in the Spelling panel.
Notes:
problemString: Problematic grammatical unit identified by checkGrammarOfString.
detail: One of the grammar-analysis details provided by checkGrammarOfString.

Available in Mac OS X v10.5 and later.

Feedback, Comments & Corrections

NSSpellCheckerMBS.updateSpellingPanelWithMisspelledWord(word as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 7.1 Yes No No Yes, macOS only No
Function: Updates the panel with the word.
Notes: The checkSpellingOfString methods return the range of the misspelled word found. It is up to the client to select that word in their document and to cause the spelling panel to update itself to reflect the found misspelling. Clients can call updateSpellPanelWithMisspelledWord to insure that the spell panel is up to date.

Feedback, Comments & Corrections

NSSpellCheckerMBS.userPreferredLanguages as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Provides a subset of the available languages to be used for spell checking.
Notes:
Returns an array containing the user's preferred languages for spell checking. The order is set in the system preferences.

If automaticallyIdentifiesLanguages is true, then text checking will automatically use this method as appropriate; otherwise, it will use the language set by Language property.

The older checkSpellingOfString and checkGrammarOfString methods will use the language set by Language property, if they are called with an empty language argument.

Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSSpellCheckerMBS.userQuotesArrayForLanguage(lang as string) as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Returns the default values for quote replacement.
Example:
dim n as new NSSpellCheckerMBS

dim en(-1) as string = n.userQuotesArrayForLanguage("en")

MsgBox Join(en," ")
Notes:
An array of quote replacements used by the NSTextCheckingQuotesKey key-value pair.

Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSSpellCheckerMBS.userReplacementsDictionary as dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 9.6 Yes No No Yes, macOS only No
Function: Returns the dictionary used when replacing words.
Notes:
The key-value pairs in this dictionary are used by the NSTextCheckingQuotesKey when replacing characters and words.

Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSSpellCheckerMBS.WordFieldValue as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Spell Checking MBS MacCocoa Plugin 11.3 Yes No No Yes, macOS only No
Function: The word textfield content string.
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacCocoa Plugin.




Links
MBS Xojo Chart Plugins