linguisticTags(in:scheme:options:orthography:tokenRanges:)
Returns an array of linguistic tags for the specified range and requested tags within the receiving string.
Declaration
func linguisticTags(in range: NSRange, scheme: NSLinguisticTagScheme, options: NSLinguisticTagger.Options = [], orthography: NSOrthography?, tokenRanges: AutoreleasingUnsafeMutablePointer<NSArray?>?) -> [NSLinguisticTag]Parameters
- range:
The range of the string to analyze.
- scheme:
The tag scheme to use. See Linguistic Tag Schemes for supported values.
- options:
The linguistic tagger options to use. See Options 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
NSValueobjects.
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 linguisticTags(in:scheme:options:orthography:tokenRanges:).