Class

NLLanguageRecognizer

The language of a body of text.

Declaration

@interface NLLanguageRecognizer : NSObject

Overview

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, dominantLanguageForString:, to get the most likely language without creating an NLLanguageRecognizer.

Topics

Creating a Recognizer

- init

Creates a recognizer that you can customize.

Determining the Language

+ dominantLanguageForString:

Finds the most likely language of a piece of text.

- processString:

Analyzes the piece of text to determine its dominant language.

dominantLanguage

The most likely language for the processed text.

- languageHypothesesWithMaximum:

Generates the probabilities of possible languages for the processed text.

- reset

Resets the recognizer to its initial state.

Guiding the Recognizer

languageHints

A dictionary that maps languages to their probabilities in the language identification process.

languageConstraints

Limits the set of possible languages that the recognizer will return.

Relationships

Inherits From

See Also

Language Identification

NLLanguage

The languages supported by the Natural Language framework.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software