skillner.core.Span#

class skillner.core.Span[source]#

Span class that stores all candidates of matching.

A span extends from the most-left to most-right candidates.

Attributes:
window: slice

A slice that delimits the span from the most-left to most-right candidate.

start: int

The index of the first word in the most-left candidate.

end: int

The index of the last word in the most-right candidate.

__init__() None[source]#

Methods

__init__()

add_candidate(candidate)

Add candidate to existing candidates and update span window.

is_empty()

Return whether the span is empty.

Attributes

window

add_candidate(candidate: Candidate) None[source]#

Add candidate to existing candidates and update span window.

is_empty() bool[source]#

Return whether the span is empty.

A span is considered empty if it has no candidates or has zero-size window.