Instance Method

tagsInRange:unit:scheme:options:tokenRanges:

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

Declaration

- (NSArray<NLTag> *)tagsInRange:(NSRange)range unit:(NLTokenUnit)unit scheme:(NLTagScheme)scheme options:(NLTaggerOptions)options tokenRanges:(NSArray<NSValue *> * _Nullable *)tokenRanges;

Parameters

range

The range from which to return tags.

unit

The linguistic unit. See NLTokenUnit for possible values.

scheme

The tag scheme. See NLTagScheme for possible values.

options

The linguistic tagger options to use. See NLTaggerOptions 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 ("").

See Also

Getting Linguistic Tags

- tagAtIndex:unit:scheme:tokenRange:

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