ContextPassage#

class scikitplot.corpus.ContextPassage(hit, spans)[source]#

The context a compressor kept from one hit.

Parameters:
hitPlannedHit

The hit.

spanstuple of (int, int)

Ordered, non-overlapping character ranges of hit.doc.text.

Parameters:

Notes

User. text is the spans’ text joined by newlines, so every character of a passage is a character of its source at a known offset.

property chars: int#

Characters of source kept (separators not counted).

hit: PlannedHit[source]#
spans: tuple[tuple[int, int], ...][source]#
property text: str#

each span of the source, joined by newlines.

Type:

The kept text