<!--
{
  "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/enumerateLinguisticTags(in:scheme:options:orthography:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSString(im)enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:"
  },
  "title" : "enumerateLinguisticTags(in:scheme:options:orthography:using:)"
}
-->

# enumerateLinguisticTags(in:scheme:options:orthography:using:)

Performs linguistic analysis on the specified string by enumerating the specific range of the string, providing the Block with the located tags.

```
func enumerateLinguisticTags(in range: NSRange, scheme: NSLinguisticTagScheme, options: NSLinguisticTagger.Options = [], orthography: NSOrthography?, using block: (NSLinguisticTag?, NSRange, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)
```

## 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.

`block`

The Block to apply to the string.

    The block takes four arguments:

- tag: The tag scheme for the token. The opts parameter specifies the types of tagger options that are located.
- tokenRange: The range of a string matching the tag scheme.
- sentenceRange: The range of the sentence in which the token is found.
- stop: A reference to a Boolean value. The block can set the value to <doc://com.apple.documentation/documentation/Swift/true> to stop further processing of the array. The `stop` argument is an out-only argument. You should only ever set this Boolean to <doc://com.apple.documentation/documentation/Swift/true> within the Block.

## Discussion

This is a convenience method.  It is the equivalent of creating an instance of `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 [`enumerateTags(in:scheme:options:using:)`](/documentation/Foundation/NSLinguisticTagger/enumerateTags(in:scheme:options:using:)).

---

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)