Contents

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

  • stringToCheck:

    String to analyze.

  • startingOffset:

    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.

  • wrapFlag:

    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.

  • 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.

  • details:

    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.

See Also

Checking Strings for Spelling and Grammar