colonel.word module¶
Module providing the Word class.
-
class
colonel.word.Word(index=None, head=None, deprel=None, **kwargs)[source]¶ Bases:
colonel.base_rich_sentence_element.BaseRichSentenceElementRepresentation of a Word sentence element
-
deprel¶ Universal dependency relation to the
heador a defined language-specific subtype of one.It is compatible with CoNLL-U
DEPRELfield.
-
head¶ Head of the current word, which is usually a value of another Word’s
indexor zero (0, forrootgrammatical relations).It is compatible with CoNLL-U
HEADfield.
-
index¶ Word index.
It is compatible with CoNLL-U
IDfield.The term index has been preferred over the more conventional ID, mostly for the purpose of preventing confusion, especially with Python’s
id()built-in function (which returns the “identity” of an object).
-
is_valid()[source]¶ Returns whether or not the object can be considered valid, however ignoring the context of the sentence in which the word itself is possibly inserted.
In compliance with the CoNLL-U format, an instance of type
Wordis considered valid only whenindexis set to a value greater than zero (0).Return type: bool
-