Instance Method

tagsInRange:scheme:options:tokenRanges:

Returns an array of linguistic tags and token ranges for a given string range.

Declaration

- (NSArray<NSString *> *)tagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts tokenRanges:(NSArray<NSValue *> * _Nullable *)tokenRanges;

Parameters

range

The range from which to return tags.

tagScheme

The tag scheme. See NSLinguisticTagScheme for possible values.

opts

The linguistic tagger options to use. See NSLinguisticTaggerOptions for possible values.

tokenRanges

Returns by reference an array of token ranges.

Return Value

An array of the tags in the requested range.

Discussion

When the returned array contains an entry that doesn't have a corresponding tag scheme, that entry is an empty string ("").

This is a convenience method for calling tagsInRange:unit:scheme:options:tokenRanges: and passing NSLinguisticTaggerUnitWord as the linguistic unit.

See Also

Getting Linguistic Tags

- tagAtIndex:unit:scheme:tokenRange:

Returns a tag for a single scheme, for a given linguistic unit, at the specified character position.

- tagAtIndex:scheme:tokenRange:sentenceRange:

Returns a tag for a single scheme at the specified character position.

+ tagForString:atIndex:unit:scheme:orthography:tokenRange:

Returns a tag for a single scheme, for a given linguistic unit, at the specified character position in a string.

- tagsInRange:unit:scheme:options:tokenRanges:

Returns an array of linguistic tags and token ranges for a given string range and linguistic unit.

+ tagsForString:range:unit:scheme:options:orthography:tokenRanges:

Returns an array of linguistic tags and token ranges for a given string and linguistic unit.