Instance Method

tokenRange(at:unit:)

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

Declaration

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

Parameters

index

The character index to begin examination.

unit

The linguistic unit. For possible values, see NLTokenUnit.

Return Value

The range of the substring for the linguistic unit.

See Also

Deteriming the Range of a Unit Token

enum NLTokenUnit

Constants representing linguistic units.