Enumeration

NLTokenUnit

Constants representing linguistic units.

Declaration

enum NLTokenUnit : Int

Overview

You use these constants with the availableTagSchemes(for:language:) method as well as the tag(at:unit:scheme:), tags(in:unit:scheme:options:) and enumerateTags(in:unit:scheme:options:using:) methods.

Topics

Constants

case document

The document in its entirety.

case paragraph

An individual paragraph.

case sentence

An individual sentence.

case word

An individual word.

See Also

Deteriming the Range of a Unit Token

func tokenRange(at: String.Index, unit: NLTokenUnit) -> Range<String.Index>

Returns the range of the linguistic unit containing the specified character index.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software