segram.nlp.tokens.abc module

Abstract base class for segram-enhanced spacy tokens.

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

Bases: ABC

Abstract base class for NLP tokens.

tok

Base spacy token object.

__repr__() str[source]

String representation.

__eq__(other: Self) bool[source]

Check equality with another token of the same type.

is_comparable_with(other: Any) bool[source]

Check if self defines the same abstract interface as other.

classmethod sns(tok: Doc | Span | Token) Self[source]

Get segram namespace from spacy token.