struct

Zh2Vi::Token

Inherits Struct < Value < Object

Token represents a leaf node with linguistic information from HanLP

Constructors

new(text : String, pos : String, ner : String | Nil = nil, dep_head : Int32 = 0, dep_rel : String = "root")
Source

Instance methods

dep_head

Index of the head word in dependency tree (0 = root)

Source
dep_rel

Dependency relation label (nsubj, dobj, etc.)

Source
ner

OntoNotes NER label (PERSON, ORG, GPE, DATE, etc.)

Source
pos

CTB POS tag (NN, VV, LC, DEC, DEG, BA, etc.)

Source
text

Original Chinese text

Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source