Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

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.checkString(text as string, range as NSRangeMBS = nil, checkingTypes as Int64 = -1, options as Dictionary = nil, byref orthography as NSOrthographyMBS, byref wordCount as Integer) as NSTextCheckingResultMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Requests unified text checking for the given range of the given string.
Notes:
text: The string to check.
range: The range of the string to check.
checkingTypes: The type of checking to be performed. The possible constants are listed in NSTextCheckingType and can be combined using the C bit-wise OR operator to perform multiple checks at the same time.
options: The options dictionary specifying the types of checking to perform. See Spell Checking Option Dictionary Keys for the possible keys and expected values.

orthography: Returns by-reference, the orthography of the range of the string. See NSOrthographyMBS for more information.
wordCount: Returns by-reference, the word count for the range of the string.

Returns an array of NSTextCheckingResultMBS objects describing particular items found during checking and their individual ranges, sorted by range origin, then range end, then result type.

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.correctionForWordRange(range as NSRangeMBS, text as string, language as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Returns a single proposed correction if a word is mis-spelled.
Notes:
range: The range of the word to be corrected.
text: The string containing the proposed correction.
language: The language.

Returns the proposed correct string.

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.deletesAutospaceBetweenString(precedingString as string, followingString as string, language as String = "") as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Deletes auto space between strings.
Notes: In some cases the space automatically inserted after an accepted candidate should be deleted when the next text is typed (e.g. if it is a period or comma). This method allows clients to recognize these cases in a standardized way.

Feedback, Comments & Corrections

NSSpellCheckerMBS.dismissCorrectionIndicatorForView(view as NSViewMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Dismisses the correction indicator for the specified view.

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.languageForWordRange(range as NSRangeMBS, text as string, orthography as NSOrthographyMBS = nil) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Clients who have an NSOrthography from NSTextCheckingTypeOrthography checking and wish to determine a specific language from it for a particular word.

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.menuForResult(TextCheckingResult as NSTextCheckingResultMBS, checkedString as string, options as Dictionary = nil, atLocation as NSPointMBS, view as NSViewMBS) as NSMenuMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Provides a menu containing contextual menu items suitable for certain kinds of detected results.
Notes:
TextCheckingResult: The NSTextCheckingResult instance for the checked string.
checkedString: The string that has been checked.
options: The options dictionary allows clients to pass in information associated with the document. See Spell Checking Option Dictionary Keys for possible key-value pairs.
location: The location, in the view’s coordinate system, to display the menu.
view: The view object over which to display the contextual menu.

Returns a menu suitable for displaying as a contextual menu, or adding to another contextual menu as a submenu.

Feedback, Comments & Corrections

NSSpellCheckerMBS.preventsAutocorrectionBeforeString(text as string, language as String = "") as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: In some cases the next typing should prevent a pending correction (if it is an @, for example).
Notes: This method allows clients to recognize these cases in a standardized way.

Feedback, Comments & Corrections

NSSpellCheckerMBS.recordResponse(response as Integer, correction as string, word as string, language as String = "")
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Records the user response to the correction indicator being displayed.
Notes:
response: The user’s response. The possible values are shown in NSCorrectionResponse.
correction: The corrected word. This should match the original correction.
word: The original word. This should match the original correction.
language: The language being edited. This should match the original correction.

When a correction is automatically proposed, the user may respond in one of several ways. Clients may report this to the spell checker so that it can learn from the user's response and adjust future correction behavior accordingly.

Use of this method implies that the client stored the original word and original correction at least from the point at which the user accepts it until the user edits or reverts it.

Feedback, Comments & Corrections

NSSpellCheckerMBS.requestCandidatesForSelectedRange(selectedRange as NSRangeMBS, stringToCheck as string, types as Int64 = -1, options as Dictionary = nil, tag as Variant = nil) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Requests candidates in background.

Feedback, Comments & Corrections

NSSpellCheckerMBS.requestCheckingOfString(stringToCheck as string, range as NSRangeMBS, types as Int64 = -1, options as Dictionary = nil, tag as Variant = nil) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Spell Checking MBS MacCocoa Plugin 19.1 Yes No No Yes, macOS only No
Function: Requests that the string be checked in the background.
Notes:
stringToCheck: The string to check.
range: The range of the string to check.
types: The type of checking to be performed. The possible constants are listed in NSTextCheckingType and can be combined using the C bit-wise OR operator to perform multiple checks at the same time.
options: The options dictionary specifying the types of checking to perform. See Spell Checking Option Dictionary Keys for the possible keys and expected values.
tag: An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.

The return value is a monotonically increasing sequence number that can be used to keep track of requests in flight.

Calls requestCheckingOfStringCompleted event later on main thread.

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

Next items

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

The biggest plugin in space...




Links
MBS Xojo Chart Plugins