Returns the range of the linguistic unit containing the specified character index.
SDKs
- iOS 12.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 12.0+
- watchOS 5.0+
Framework
- Natural Language
Declaration
- (NSRange)tokenRangeAtIndex:(NSUInteger)characterIndex unit:(NLToken Unit)unit;
Parameters
characterIndex
The character index to begin examination.
unit
The linguistic unit. For possible values, see
NLToken
.Unit
Return Value
The range of the substring for the linguistic unit.