Contents

tags(in:unit:scheme:options:)

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

Declaration

@nonobjc func tags(in range: Range<String.Index>, unit: NLTokenUnit, scheme: NLTagScheme, options: NLTagger.Options = []) -> [(NLTag?, Range<String.Index>)]

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 Options for possible values.

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