mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
439f30faad
* Add stub files for main API classes * Add contributor agreement for ezorita * Update types for ndarray and hash() * Fix __getitem__ and __iter__ * Add attributes of Doc and Token classes * Overload type hints for Span.__getitem__ * Fix type hint overload for Span.__getitem__ Co-authored-by: Luca Dorigo <dorigoluca@gmail.com>
25 lines
694 B
Python
25 lines
694 B
Python
from typing import Any, Dict, Iterable
|
|
from .doc import Doc
|
|
from .span import Span
|
|
|
|
class SpanGroup:
|
|
def __init__(
|
|
self,
|
|
doc: Doc,
|
|
*,
|
|
name: str = ...,
|
|
attrs: Dict[str, Any] = ...,
|
|
spans: Iterable[Span] = ...
|
|
) -> None: ...
|
|
def __repr__(self) -> str: ...
|
|
@property
|
|
def doc(self) -> Doc: ...
|
|
@property
|
|
def has_overlap(self) -> bool: ...
|
|
def __len__(self) -> int: ...
|
|
def append(self, span: Span) -> None: ...
|
|
def extend(self, spans: Iterable[Span]) -> None: ...
|
|
def __getitem__(self, i: int) -> Span: ...
|
|
def to_bytes(self) -> bytes: ...
|
|
def from_bytes(self, bytes_data: bytes) -> SpanGroup: ...
|