<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NaturalLanguage",
  "identifier" : "/documentation/NaturalLanguage/NLTag",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Natural Language"
    ],
    "preciseIdentifier" : "c:@T@NLTag"
  },
  "title" : "NLTag"
}
-->

# NLTag

A token type, lexical class, name, lemma, language, or script returned by a linguistic tagger for natural language text.

```
struct NLTag
```

## Overview

When you create a linguistic tagger, you specify one or more [`NLTagScheme`](/documentation/NaturalLanguage/NLTagScheme) constants that correspond to the kind of information you want to know about a selection of natural language text. When working with linguistic tags using the methods described in Getting linguistic tags and Enumerating linguistic tags in [`NLTagger`](/documentation/NaturalLanguage/NLTagger), the returned value depends on the specified scheme. The [`NLTag`](/documentation/NaturalLanguage/NLTag) type represents the constant values that can be returned for certain [`NLTagScheme`](/documentation/NaturalLanguage/NLTagScheme) values.

## Topics

### Token types

Constants representing the token type of a tag with the [`static let tokenType: NLTagScheme`](/documentation/NaturalLanguage/NLTagScheme/tokenType)

A scheme that classifies tokens according to their broad type: word, punctuation, or whitespace. scheme.

[`static let word: NLTag`](/documentation/NaturalLanguage/NLTag/word)

A tag indicating that the token is a word.

[`static let punctuation: NLTag`](/documentation/NaturalLanguage/NLTag/punctuation)

A tag indicating that the token is punctuation.

[`static let whitespace: NLTag`](/documentation/NaturalLanguage/NLTag/whitespace)

A tag indicating that the token is white space of any sort.

[`static let other: NLTag`](/documentation/NaturalLanguage/NLTag/other)

A tag indicating that the token is a non-linguistic item, such as a symbol.

### Lexical classes

Constants specifying the lexical class of a tag with the [`static let lexicalClass: NLTagScheme`](/documentation/NaturalLanguage/NLTagScheme/lexicalClass)

A scheme that classifies tokens according to class: part of speech, type of punctuation, or whitespace. or [`static let nameTypeOrLexicalClass: NLTagScheme`](/documentation/NaturalLanguage/NLTagScheme/nameTypeOrLexicalClass)

A scheme that classifies tokens corresponding to names according to [`nameType`](/documentation/NaturalLanguage/NLTagScheme/nameType), and classifies all other tokens according to [`lexicalClass`](/documentation/NaturalLanguage/NLTagScheme/lexicalClass). scheme.

[`static let noun: NLTag`](/documentation/NaturalLanguage/NLTag/noun)

A tag indicating that the token is a noun.

[`static let verb: NLTag`](/documentation/NaturalLanguage/NLTag/verb)

A tag indicating that the token is a verb.

[`static let adjective: NLTag`](/documentation/NaturalLanguage/NLTag/adjective)

A tag indicating that the token is an adjective

[`static let adverb: NLTag`](/documentation/NaturalLanguage/NLTag/adverb)

A tag indicating that the token is an adverb.

[`static let pronoun: NLTag`](/documentation/NaturalLanguage/NLTag/pronoun)

A tag indicating that the token is a pronoun.

[`static let determiner: NLTag`](/documentation/NaturalLanguage/NLTag/determiner)

A tag indicating that the token is a determiner.

[`static let particle: NLTag`](/documentation/NaturalLanguage/NLTag/particle)

A tag indicating that the token is a particle.

[`static let preposition: NLTag`](/documentation/NaturalLanguage/NLTag/preposition)

A tag indicating that the token is a preposition.

[`static let number: NLTag`](/documentation/NaturalLanguage/NLTag/number)

A tag indicating that the token is a number.

[`static let conjunction: NLTag`](/documentation/NaturalLanguage/NLTag/conjunction)

A tag indicating that the token is a conjunction.

[`static let interjection: NLTag`](/documentation/NaturalLanguage/NLTag/interjection)

A tag indicating that the token is an interjection.

[`static let classifier: NLTag`](/documentation/NaturalLanguage/NLTag/classifier)

A tag indicating that the token is a classifier.

[`static let idiom: NLTag`](/documentation/NaturalLanguage/NLTag/idiom)

A tag indicating that the token is an idiom.

[`static let otherWord: NLTag`](/documentation/NaturalLanguage/NLTag/otherWord)

A tag indicating that the token is a word other than a kind described by other lexical classes (noun, verb, adjective, adverb, pronoun, determiner, particle, preposition, number, conjunction, interjection, classifier, and idiom).

[`static let sentenceTerminator: NLTag`](/documentation/NaturalLanguage/NLTag/sentenceTerminator)

A tag indicating that the token is punctuation at the end of a sentence.

[`static let openQuote: NLTag`](/documentation/NaturalLanguage/NLTag/openQuote)

A tag indicating that the token is an open quote.

[`static let closeQuote: NLTag`](/documentation/NaturalLanguage/NLTag/closeQuote)

A tag indicating that the token is a close quote.

[`static let openParenthesis: NLTag`](/documentation/NaturalLanguage/NLTag/openParenthesis)

A tag indicating that the token is an open parenthesis.

[`static let closeParenthesis: NLTag`](/documentation/NaturalLanguage/NLTag/closeParenthesis)

A tag indicating that the token is a close parenthesis.

[`static let wordJoiner: NLTag`](/documentation/NaturalLanguage/NLTag/wordJoiner)

A tag indicating that the token is a word joiner, signifying that two tokens on each side should not be broken up.

[`static let dash: NLTag`](/documentation/NaturalLanguage/NLTag/dash)

A tag indicating that the token is a dash.

[`static let otherPunctuation: NLTag`](/documentation/NaturalLanguage/NLTag/otherPunctuation)

A tag indicating that the token is punctuation other than a kind described by other lexical classes (sentence terminator, open or close quote, open or close parenthesis, word joiner, and dash).

[`static let paragraphBreak: NLTag`](/documentation/NaturalLanguage/NLTag/paragraphBreak)

A tag indicating that the token is a paragraph break.

[`static let otherWhitespace: NLTag`](/documentation/NaturalLanguage/NLTag/otherWhitespace)

A tag indicating that the token is whitespace other than a kind described by other lexical classes (paragraph break).

### Name types

Constants specifying the name type of a tag with the [`static let nameType: NLTagScheme`](/documentation/NaturalLanguage/NLTagScheme/nameType)

A scheme that classifies tokens according to whether they are part of a named entity. or [`static let nameTypeOrLexicalClass: NLTagScheme`](/documentation/NaturalLanguage/NLTagScheme/nameTypeOrLexicalClass)

A scheme that classifies tokens corresponding to names according to [`nameType`](/documentation/NaturalLanguage/NLTagScheme/nameType), and classifies all other tokens according to [`lexicalClass`](/documentation/NaturalLanguage/NLTagScheme/lexicalClass). scheme.

[`static let personalName: NLTag`](/documentation/NaturalLanguage/NLTag/personalName)

A tag indicating that the token is a personal name.

[`static let organizationName: NLTag`](/documentation/NaturalLanguage/NLTag/organizationName)

A tag indicating that the token is an organization name.

[`static let placeName: NLTag`](/documentation/NaturalLanguage/NLTag/placeName)

A tag indicating that the token is a place name.

### Initializers

[`init(String)`](/documentation/NaturalLanguage/NLTag/init(_:))

Creates a new tag.

[`init(rawValue: String)`](/documentation/NaturalLanguage/NLTag/init(rawValue:))

Creates a new tag from the specified raw value.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)