---
title: "tagsInRange:unit:scheme:options:tokenRanges:"
framework: naturallanguage
role: symbol
role_heading: Instance Method
path: "naturallanguage/nltagger/tagsinrange:unit:scheme:options:tokenranges:"
---

# tagsInRange:unit:scheme:options:tokenRanges:

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

## Declaration

```occ
- (NSArray<NSString *> *) tagsInRange:(NSRange) range unit:(NLTokenUnit) unit scheme:(NLTagScheme) scheme options:(NLTaggerOptions) options tokenRanges:(NSArray<NSValue *> **) tokenRanges;
```

## Parameters

- `range`: The range from which to return tags.
- `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.
- `options`: The linguistic tagger options to use. See doc://com.apple.naturallanguage/documentation/NaturalLanguage/NLTagger/Options for possible values.
- `tokenRanges`: Returns by reference an array of token ranges.

## Return Value

Return Value An array of the tags in the requested range.

## Discussion

Discussion When the returned array contains an entry that doesn’t have a corresponding tag scheme, that entry is an empty string (””).

## See Also

### Getting linguistic tags

- [tagAtIndex:unit:scheme:tokenRange:](naturallanguage/nltagger/tagatindex:unit:scheme:tokenrange:.md)
- [tagHypothesesAtIndex:unit:scheme:maximumCount:tokenRange:](naturallanguage/nltagger/taghypothesesatindex:unit:scheme:maximumcount:tokenrange:.md)
