Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSLinguisticTaggerMBS class.

NSLinguisticTaggerMBS.availableTagSchemesForLanguage(Language as String) as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Linguistic MBS MacCocoa Plugin 17.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the tag schemes available for a particular language on the current device.

language: A BCP-47 tag identifying the language. For example, "en" for English or "zh-Hans" for Chinese written using the Simplified Chinese script.

Returns the available tag schemes. For possible values, see NSLinguisticTagScheme.

This is a convenience method for calling the availableTagSchemesForUnit, passing NSLinguisticTaggerUnitWord as the linguistic unit.

NSLinguisticTaggerMBS.availableTagSchemesForUnit(unit as Integer, Language as String) as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Linguistic MBS MacCocoa Plugin 17.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the tag schemes available for a particular unit and language on the current device.

unit: The linguistic unit. For possible values, see NSLinguisticTaggerUnit.
language: A BCP-47 tag identifying the language. For example, "en" for English or "zh-Hans" for Chinese written using the Simplified Chinese script.

Returns the supported tag schemes. For possible values, see NSLinguisticTagScheme.

Available in macOS 10.13 and newer.

NSLinguisticTaggerMBS.dominantLanguageForString(text as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Linguistic MBS MacCocoa Plugin 17.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the dominant language for the specified string.

string: The string for which the dominant language is determined.

Returns the BCP-47 tag identifying the dominant language of the string, or the tag "und" if a specific language cannot be determined.

This is a convenience method for creating a new linguistic tagger, setting the string property, and getting the dominantLanguage property. If you analyze the same string more than once, you should create a linguistic tagger object instead of calling this method.

Available in macOS 10.13 and newer.

NSLinguisticTaggerMBS.tagForString(text as string, charIndex as Integer, unit as Integer, Scheme as String, orthography as NSOrthographyMBS, byref tokenRange as NSRangeMBS) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Linguistic MBS MacCocoa Plugin 17.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a tag for a single scheme for a given linguistic unit at the specified character position in a string.

charIndex: The position of the initial character.
unit: The linguistic unit. See NSLinguisticTaggerUnit for possible values.
tagScheme: The tag scheme. See NSLinguisticTagScheme for possible values.
tokenRange: The token range for output.

Returns the tag for the requested tag scheme and linguistic unit, or nil. If a tag is returned, this function returns by reference the range of the token to tokenRange.

This is a convenience method for initializing a linguistic tagger, setting the string property, and calling the tagForString method. If you analyze the same string more than once, you should create a linguistic tagger object instead of calling this method.

NSLinguisticTaggerMBS.TagsForString(text as string, range as NSRangeMBS, unit as Integer, Scheme as String, options as Integer, orthography as NSOrthographyMBS) as NSLinguisticValueMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Linguistic MBS MacCocoa Plugin 17.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns an array of linguistic tags and token ranges.

range: The range from which to return tags.
unit: The linguistic unit. See NSLinguisticTaggerUnit for possible values.
tagScheme: The tag scheme. See NSLinguisticTagScheme for possible values.
options: The linguistic tagger options to use. See NSLinguisticTaggerOptions for possible values.

An array of the values in the requested range (tag and tokenRange set).

When the returned array contains an entry that doesn't have a corresponding tag scheme, that entry is an empty string ("").
This is a convenience method for initializing a linguistic tagger, setting the
string property, and calling the tagsInRange method. If you analyze the same string more than once, you should create a linguistic tagger object instead of calling this method.

Available in macOS 10.13 and newer.

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


The biggest plugin in space...