Instance Method

linguisticTagsInRange:scheme:options:orthography:tokenRanges:

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

Declaration

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

Parameters

range

The range of the string to analyze.

tagScheme

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

opts

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

orthography

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

tokenRanges

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.

Discussion

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.

NSStringEnumerationOptions

Constants to specify kinds of substrings and styles of enumeration.