Platforms to show: All Mac Windows Linux Cross-Platform

NLLanguageRecognizerMBS class   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Natural Language MBS MacFrameworks Plugin 26.3 ✅ Yes ❌ No ❌ No ✅ Yes All
The class to recognize the language of a body of text.
Example
var recognizer as new NLLanguageRecognizerMBS

recognizer.processString("This is ")
recognizer.processString("an English ")
recognizer.processString("document.")
recognizer.processString("What language?")

MessageBox recognizer.dominantLanguage

An NLLanguageRecognizerMBS 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 NLLanguageRecognizerMBS 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.

This class has no sub classes.

Release notes

  • Version 26.3
    • Added NLLanguageRecognizerMBS class.

The items on this page are in the following plugins: MBS MacFrameworks Plugin.


NLEmbeddingNeighborMBS   -   NotificationCenterMBS


The biggest plugin in space...