Enumerates a closure over the tagger’s string, given a range, token unit, and tag scheme.
- iOS 12.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 12.0+
- watchOS 5.0+
- Xcode 10.0+
The range of the string you want the tagger to analyze.
The tag scheme the tagger uses to tag the string, such as
script. This scheme determines which types of
NLTag the method passes to your closure. For other tag schemes, see
The closure this method uses to iterate over the tagger’s
string property. The closure has the following parameters:
The tag of the token.
The range of the token.
true from the closure to tell the tagger to continue iterating over the string; otherwise return
false to stop.
Use this method to iterate your closure over the given range of a string. The method divides up the string with the given
NLTagScheme and then calls your closure. For example, use the
lexicalClass tag scheme to identify which tokens are parts of speech, types of whitespace, or types of punctuation. Use the
lemma tag scheme to identify the stem form of each word token, if known.
Enumerating Linguistic Tags
Constants for linguistic tagger enumeration specifying which tokens to omit and whether to join names.
A token type, lexical class, name, lemma, language, or script returned by a linguistic tagger for natural language text.