Instance Method


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


- (NSArray<NSLinguisticTag> *)linguisticTagsInRange:(NSRange)range scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(NSOrthography *)orthography tokenRanges:(NSArray<NSValue *> * _Nullable *)tokenRanges;



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 NSLinguisticTaggerOptions 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 linguisticTagsInRange:scheme:options:orthography:tokenRanges:.

See Also

Performing Linguistic Analysis

- enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:

Performs linguistic analysis on the specified string by enumerating the specific range of the string, providing the Block with the located tags.


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