mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-28 19:06:33 +03:00
b56b9e7f31
* added ruler coe * added error for none existing pattern * changed error to warning * changed error to warning * added basic tests * fixed place * added test files * went back to error * went back to pattern error * minor change to docs * changed style * changed doc * changed error slightly * added remove to phrasem api * error key already existed * phrase matcher match code to api * blacked tests * moved comments before expr * corrected error no * Update website/docs/api/entityruler.md Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> * Update website/docs/api/entityruler.md Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
30 lines
855 B
Python
30 lines
855 B
Python
from typing import List, Tuple, Union, Optional, Callable, Any, Dict
|
|
|
|
from . import Matcher
|
|
from ..vocab import Vocab
|
|
from ..tokens import Doc, Span
|
|
|
|
class PhraseMatcher:
|
|
def __init__(
|
|
self, vocab: Vocab, attr: Optional[Union[int, str]], validate: bool = ...
|
|
) -> None: ...
|
|
def __reduce__(self) -> Any: ...
|
|
def __len__(self) -> int: ...
|
|
def __contains__(self, key: str) -> bool: ...
|
|
def add(
|
|
self,
|
|
key: str,
|
|
docs: List[List[Dict[str, Any]]],
|
|
*,
|
|
on_match: Optional[
|
|
Callable[[Matcher, Doc, int, List[Tuple[Any, ...]]], Any]
|
|
] = ...,
|
|
) -> None: ...
|
|
def remove(self, key: str) -> None: ...
|
|
def __call__(
|
|
self,
|
|
doclike: Union[Doc, Span],
|
|
*,
|
|
as_spans: bool = ...,
|
|
) -> Union[List[Tuple[int, int, int]], List[Span]]: ...
|