Analyze natural language text to tag part of speech and lexical class, identify names, perform lemmatization, and determine the language and script.
- iOS 5.0+
- macOS 10.7+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
NSLinguistic provides a uniform interface to a variety of natural language processing functionality with support for many different languages and scripts. You can use this class to segment natural language text into paragraphs, sentences, or words, and tag information about those segments, such as part of speech, lexical class, lemma, script, and language.
When you create a linguistic tagger, you specify what kind of information you're interested in by passing one or more
NSLinguistic values. Set the
string property to the natural language text you want to analyze, and the linguistic tagger processes it according to the specified tag schemes. You can then enumerate over the tags in a specified range, using the methods described in Enumerating Linguistic Tags, to get the information requested for a given scheme and unit.
A single instance of
NSLinguistic should not be used simultaneously from multiple threads.