---
title: NLLanguageRecognizer
framework: naturallanguage
role: symbol
role_heading: Class
path: naturallanguage/nllanguagerecognizer
---

# NLLanguageRecognizer

The language of a body of text.

## Declaration

```swift
class NLLanguageRecognizer
```

## Mentioned in

Identifying the language in text

## Overview

Overview An NLLanguageRecognizer object automatically detects the language of a piece of text. It performs language identification by: Identifying the dominant script of a piece of text. Some languages have a unique script (like Greek), but others share the same script (like English, French, and German, which all share the Latin script). Identifying the language itself. The identification obtained from an NLLanguageRecognizer object can be either a single most likely language, access through dominantLanguage, or a set of language candidates with probabilities, using languageHypothesesWithMaximum:. You can reset the recognizer to its initial state, to be reused for new analysis. Use the convenience method, dominantLanguage(for:), to get the most likely language without creating an NLLanguageRecognizer. important: Don’t use an instance of NLLanguageRecognizer from more than one thread simultaneously.

## Topics

### Creating a recognizer

- [init()](naturallanguage/nllanguagerecognizer/init().md)

### Determining the language

- [dominantLanguage(for:)](naturallanguage/nllanguagerecognizer/dominantlanguage(for:).md)
- [processString(_:)](naturallanguage/nllanguagerecognizer/processstring(_:).md)
- [dominantLanguage](naturallanguage/nllanguagerecognizer/dominantlanguage.md)
- [languageHypotheses(withMaximum:)](naturallanguage/nllanguagerecognizer/languagehypotheses(withmaximum:).md)
- [reset()](naturallanguage/nllanguagerecognizer/reset().md)

### Guiding the recognizer

- [languageHints](naturallanguage/nllanguagerecognizer/languagehints-7dwgv.md)
- [languageConstraints](naturallanguage/nllanguagerecognizer/languageconstraints.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Language identification

- [Identifying the language in text](naturallanguage/identifying-the-language-in-text.md)
- [NLLanguage](naturallanguage/nllanguage.md)
