Constants for linguistic tagger enumeration specifying which tokens to omit and whether to join names.
SDKs
- iOS 12.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 12.0+
- watchOS 5.0+
Framework
- Natural Language
Declaration
struct Options
Constants for linguistic tagger enumeration specifying which tokens to omit and whether to join names.
SDKs
Framework
struct Options
static var omit Words: NLTagger .Options
Omit tokens of type word
(items considered to be words).
static var omit Punctuation: NLTagger .Options
Omit tokens of type punctuation
(all punctuation).
static var omit Whitespace: NLTagger .Options
Omit tokens of type whitespace
(whitespace of all sorts).
static var omit Other: NLTagger .Options
Omit tokens of type other
(non-linguistic items, such as symbols).
static var join Names: NLTagger .Options
Typically, multiple-word names will be returned as multiple tokens, following the standard tokenization practice of the tagger.
static var join Contractions: NLTagger .Options
Contractions will be returned as one token.
init(raw Value: UInt)
Creates the option with a raw value.
func enumerate Tags(in: Range<String .Index>, unit: NLToken Unit, scheme: NLTag Scheme, options: NLTagger .Options, using: (NLTag?, Range<String .Index>) -> Bool)
Enumerates a closure over the tagger’s string, given a range, token unit, and tag scheme.
struct NLTag
A token type, lexical class, name, lemma, language, or script returned by a linguistic tagger for natural language text.