Contents

tags(in:scheme:options:tokenRanges:)

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

Declaration

func tags(in range: NSRange, scheme tagScheme: String, options opts: NSLinguisticTagger.Options = [], tokenRanges: AutoreleasingUnsafeMutablePointer<NSArray?>?) -> [String]

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 Options 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 tags(in:unit:scheme:options:tokenRanges:) and passing NSLinguisticTaggerUnit.word as the linguistic unit.

See Also

Getting Linguistic Tags