---
title: "tagAtIndex:unit:scheme:tokenRange:"
framework: naturallanguage
role: symbol
role_heading: Instance Method
path: "naturallanguage/nltagger/tagatindex:unit:scheme:tokenrange:"
---

# tagAtIndex:unit:scheme:tokenRange:

Finds a tag for a given linguistic unit, for a single scheme, at the specified character position.

## Declaration

```occ
- (NLTag) tagAtIndex:(NSUInteger) characterIndex unit:(NLTokenUnit) unit scheme:(NLTagScheme) scheme tokenRange:(NSRangePointer) tokenRange;
```

## Parameters

- `characterIndex`: The position of the initial character.
- `unit`: The linguistic unit. See doc://com.apple.naturallanguage/documentation/NaturalLanguage/NLTokenUnit for possible values.
- `scheme`: The tag scheme. See doc://com.apple.naturallanguage/documentation/NaturalLanguage/NLTagScheme for possible values.
- `tokenRange`: A pointer to the token range.

## Return Value

Return Value The tag for the requested tag scheme and linguistic unit, or nil. If a tag is returned, this function returns by reference the range of the token to tokenRange.

## See Also

### Getting linguistic tags

- [tagsInRange:unit:scheme:options:tokenRanges:](naturallanguage/nltagger/tagsinrange:unit:scheme:options:tokenranges:.md)
- [tagHypothesesAtIndex:unit:scheme:maximumCount:tokenRange:](naturallanguage/nltagger/taghypothesesatindex:unit:scheme:maximumcount:tokenrange:.md)
