Instance Method

checkGrammar(of:startingAt:language:wrap:inSpellDocumentWithTag:details:)

Initiates a grammatical analysis of a given string.

Declaration

func checkGrammar(of stringToCheck: String, startingAt startingOffset: Int, language: String?, wrap wrapFlag: Bool, inSpellDocumentWithTag tag: Int, details: AutoreleasingUnsafeMutablePointer<NSArray?>?) -> NSRange

Parameters

string

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.

documentTag

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.

outDetails

On output, dictionaries describing grammar-analysis details within the flagged grammatical unit. See the NSSpellServer class for information about these dictionaries.

Return Value

Location of the first flagged grammatical unit.