---
title: "dominantLanguage(for:)"
framework: naturallanguage
role: symbol
role_heading: Type Method
path: "naturallanguage/nllanguagerecognizer/dominantlanguage(for:)"
---

# dominantLanguage(for:)

Finds the most likely language of a piece of text.

## Declaration

```swift
class func dominantLanguage(for string: String) -> NLLanguage?
```

## Parameters

- `string`: The text to analyze.

## Return Value

Return Value The most probable language of the piece of text.

## See Also

### Determining the language

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