Instance Method


Returns an array of linguistic tags for the specified range and requested tags within the receiving string.


func linguisticTags(in range: NSRange, scheme: NSLinguisticTagScheme, options: NSLinguisticTagger.Options = [], orthography: NSOrthography?, tokenRanges: AutoreleasingUnsafeMutablePointer<NSArray?>?) -> [NSLinguisticTag]



The range of the string to analyze.


The tag scheme to use. See Linguistic Tag Schemes for supported values.


The linguistic tagger options to use. See NSLinguisticTagger.Options for the constants. These constants can be combined using the C-Bitwise OR operator.


The orthography of the string. If nil, the linguistic tagger will attempt to determine the orthography from the string content.


An array returned by-reference containing the token ranges of the linguistic tags wrapped in NSValue objects.

Return Value

Returns an array containing the linguistic tags for the tokenRanges within the receiving string.


This is a convenience method. It is the equivalent of creating an instance of NSLinguisticTagger, specifying the receiver as the string to be analyzed, and the orthography (or nil) and then invoking the NSLinguisticTagger method or linguisticTags(in:scheme:options:orthography:tokenRanges:).

See Also

Performing Linguistic Analysis

struct NSString.EnumerationOptions

Constants to specify kinds of substrings and styles of enumeration.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software