Returns the dominant language for the specified string.
- iOS 11.0+
- macOS 10.13+
- tvOS 11.0+
- watchOS 4.0+
The string for which the dominant language is determined.
The BCP-47 tag identifying the dominant language of the string, or the tag "und" if a specific language cannot be determined.
dominant method is a convenience method for creating a new linguistic tagger, setting the
string property, and getting the
dominant property. If you analyze the same string more than once, create a linguistic tagger object instead of calling the method, as shown in this example:
In the example, the BCP-47 language tag "de" is returned as the dominant language, indicating that the text is in German.