mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 02:16:32 +03:00
26 lines
690 B
Python
26 lines
690 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 __call__(
|
||
|
self,
|
||
|
doclike: Union[Doc, Span],
|
||
|
*,
|
||
|
as_spans: bool = ...,
|
||
|
) -> Union[List[Tuple[int, int, int]], List[Span]]: ...
|
||
|
def add(
|
||
|
self,
|
||
|
key: str,
|
||
|
docs: List[List[Dict[str, Any]]],
|
||
|
*,
|
||
|
on_match: Optional[
|
||
|
Callable[[Matcher, Doc, int, List[Tuple[Any, ...]]], Any]
|
||
|
] = ...,
|
||
|
) -> None: ...
|