---
title: dominantLanguage
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nslinguistictagger/dominantlanguage
---

# dominantLanguage

Returns the dominant language of the string set for the linguistic tagger.

## Declaration

```swift
var dominantLanguage: String? { get }
```

## Return Value

Return Value The BCP-47 tag identifying the dominant language of the string, or the tag “und” if a specific language cannot be determined.

## Discussion

Discussion If you want to know the dominant language of a string that you’re analyzing with a linguistic tagger (for example, identifying part of speech for each word), specify the language tag scheme in the initializer. After you set the string property of the linguistic tagger, the dominant language can be determined with the dominantLanguage property, as shown in this example: let text = "Die Kleinen haben friedlich zusammen gespielt." let tagger = NSLinguisticTagger(tagSchemes: [.language], options: 0) tagger.string = text tagger.dominantLanguage // "de" In the example, the BCP-47 language tag “de” is returned as the dominant language, indicating that the text is in German.

## See Also

### Determining the Dominant Language and Orthography

- [dominantLanguage(for:)](foundation/nslinguistictagger/dominantlanguage(for:).md)
- [orthography(at:effectiveRange:)](foundation/nslinguistictagger/orthography(at:effectiverange:).md)
- [setOrthography(_:range:)](foundation/nslinguistictagger/setorthography(_:range:).md)
