---
title: NSLinguisticTagScheme
framework: foundation
role: symbol
role_heading: Structure
path: foundation/nslinguistictagscheme
---

# NSLinguisticTagScheme

Constants for the tag schemes specified when initializing a linguistic tagger.

## Declaration

```swift
struct NSLinguisticTagScheme
```

## Discussion

Discussion When initializing a linguistic tagger with init(tagSchemes:options:), you specify one or more tag schemes that correspond to the kind of information you’re interested in for a selection of natural language text. To ensure optimal performance, avoid specifying tag schemes that you won’t use. Some tag schemes are only available for certain units and languages. Use the availableTagSchemes(for:language:) or availableTagSchemes(forLanguage:) methods to determine the possible values for a specified language and linguistic unit. When working with linguistic tags using the methods described in Getting Linguistic Tags and Enumerating Linguistic Tags, the returned tag value depends on the specified scheme. For example, given the token “Überraschung”, the returned tag is noun when using the lexicalClass tag scheme, “de” (German language) when using the language tag scheme, and “Latn” (Latin script) when using the script tag scheme, as shown in the following code. let tagger = NSLinguisticTagger(tagSchemes: [.lexicalClass, .language, .script], options: 0) tagger.string = "Überraschung"

tagger.tag(at: 0, unit: .word, scheme: .lexicalClass, tokenRange: nil) // Noun tagger.tag(at: 0, unit: .word, scheme: .language, tokenRange: nil) // de tagger.tag(at: 0, unit: .word, scheme: .script, tokenRange: nil) // Latn The following table lists the available tag schemes, their applicable linguistic units, and possible tag values.  |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |

## Topics

### Schemes

- [tokenType](foundation/nslinguistictagscheme/tokentype.md)
- [lexicalClass](foundation/nslinguistictagscheme/lexicalclass.md)
- [nameType](foundation/nslinguistictagscheme/nametype.md)
- [nameTypeOrLexicalClass](foundation/nslinguistictagscheme/nametypeorlexicalclass.md)
- [lemma](foundation/nslinguistictagscheme/lemma.md)
- [language](foundation/nslinguistictagscheme/language.md)
- [script](foundation/nslinguistictagscheme/script.md)

### Initializers

- [init(_:)](foundation/nslinguistictagscheme/init(_:).md)
- [init(rawValue:)](foundation/nslinguistictagscheme/init(rawvalue:).md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Supporting Types

- [NSLinguisticTaggerUnit](foundation/nslinguistictaggerunit.md)
- [NSLinguisticTag](foundation/nslinguistictag.md)
