segram.nlp.tokens.token module

class segram.nlp.tokens.token.Token(tok: Doc | Span | Token)[source]

Bases: NLP

Token wrapper class.

__lt__(other: Self) bool[source]

Is self earlier in the document than other.

property coref: Self

Return main coreferred token or self.

to_str(*, color: bool = False, **kwds: Any) str[source]

Represent as a string.

Parameters:
  • color – Use colors.

  • **kwds – Passed to color_role(). They can be used to override the fixed token role with contextual roles using role keyword argument.