<!--
{
  "availability" : [
    "iOS: 5.0.0 - 27.0.0",
    "iPadOS: 5.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.7.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 2.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSString/linguisticTags(in:scheme:options:orthography:tokenRanges:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSString(im)linguisticTagsInRange:scheme:options:orthography:tokenRanges:"
  },
  "title" : "linguisticTags(in:scheme:options:orthography:tokenRanges:)"
}
-->

# linguisticTags(in:scheme:options:orthography:tokenRanges:)

Returns an array of linguistic tags for the specified range and requested tags within the receiving string.

```
func linguisticTags(in range: NSRange, scheme: NSLinguisticTagScheme, options: NSLinguisticTagger.Options = [], orthography: NSOrthography?, tokenRanges: AutoreleasingUnsafeMutablePointer<NSArray?>?) -> [NSLinguisticTag]
```

## Parameters

`range`

The range of the string to analyze.

`scheme`

The tag scheme to use. See Linguistic Tag Schemes for supported values.

`options`

The linguistic tagger options to use. See [`NSLinguisticTagger.Options`](/documentation/Foundation/NSLinguisticTagger/Options) for the constants. These constants can be combined using the C-Bitwise OR operator.

`orthography`

The orthography of the string. If `nil`, the linguistic tagger will attempt to determine the orthography from the string content.

`tokenRanges`

An array returned by-reference containing the token ranges of the linguistic tags wrapped in `NSValue` objects.

## Return Value

Returns an array containing the linguistic tags for the `tokenRanges` within the receiving string.

## Discussion

This is a convenience method.  It is the equivalent of creating an instance of [`NSLinguisticTagger`](/documentation/Foundation/NSLinguisticTagger), specifying the receiver as the string to be analyzed, and the orthography (or `nil`) and then invoking the [`NSLinguisticTagger`](/documentation/Foundation/NSLinguisticTagger) method or [`linguisticTags(in:scheme:options:orthography:tokenRanges:)`](/documentation/Foundation/NSString/linguisticTags(in:scheme:options:orthography:tokenRanges:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)