TokenDictRule
public struct TokenDictRule : Codable, Equatable
An object defining a single tokenizaion rule.
-
The string to tokenize.
Declaration
Swift
public var text: String
-
Array of tokens that the
text
field is split into when found.Declaration
Swift
public var tokens: [String]
-
Array of tokens that represent the content of the
text
field in an alternate character set.Declaration
Swift
public var readings: [String]?
-
The part of speech that the
text
string belongs to. For examplenoun
. Custom parts of speech can be specified.Declaration
Swift
public var partOfSpeech: String
-
Initialize a
TokenDictRule
with member variables.Declaration
Swift
public init( text: String, tokens: [String], partOfSpeech: String, readings: [String]? = nil )
Parameters
text
The string to tokenize.
tokens
Array of tokens that the
text
field is split into when found.partOfSpeech
The part of speech that the
text
string belongs to. For examplenoun
. Custom parts of speech can be specified.readings
Array of tokens that represent the content of the
text
field in an alternate character set.Return Value
An initialized
TokenDictRule
.