NSLinguisticTagger
Analyze natural language text to tag part of speech and lexical class, identify names, perform lemmatization, and determine the language and script.
Declaration
class NSLinguisticTaggerMentioned in
Overview
NSLinguisticTagger 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 NSLinguisticTagScheme 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.
Thread Safety
A single instance of NSLinguisticTagger should not be used simultaneously from multiple threads.
Topics
First Steps
Getting the Tag Schemes
Determining the Dominant Language and Orthography
Enumerating Linguistic Tags
Identifying Parts of SpeechIdentifying People, Places, and OrganizationsenumerateTags(in:unit:scheme:options:using:)enumerateTags(in:scheme:options:using:)enumerateTags(for:range:unit:scheme:options:orthography:using:)NSLinguisticTagger.Options
Getting Linguistic Tags
tag(at:unit:scheme:tokenRange:)tag(at:scheme:tokenRange:sentenceRange:)tag(for:at:unit:scheme:orthography:tokenRange:)tags(in:unit:scheme:options:tokenRanges:)tags(in:scheme:options:tokenRanges:)tags(for:range:unit:scheme:options:orthography:tokenRanges:)