From cbc2ae933ee84c433d92ac3845e9520f761ee3c8 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Wed, 8 Feb 2023 14:46:07 +0100 Subject: [PATCH] Remove unused Span.char_span(id=) (#12250) --- spacy/tokens/span.pyi | 1 - spacy/tokens/span.pyx | 3 +-- website/docs/api/span.mdx | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/spacy/tokens/span.pyi b/spacy/tokens/span.pyi index 979e74e7e..549990c5e 100644 --- a/spacy/tokens/span.pyi +++ b/spacy/tokens/span.pyi @@ -96,7 +96,6 @@ class Span: label: Union[int, str] = ..., kb_id: Union[int, str] = ..., vector: Optional[Floats1d] = ..., - id: Union[int, str] = ..., alignment_mode: str = ..., span_id: Union[int, str] = ..., ) -> Span: ... diff --git a/spacy/tokens/span.pyx b/spacy/tokens/span.pyx index 134849cdb..4990cb5f7 100644 --- a/spacy/tokens/span.pyx +++ b/spacy/tokens/span.pyx @@ -666,7 +666,7 @@ cdef class Span: else: return self.doc[root] - def char_span(self, int start_idx, int end_idx, label=0, kb_id=0, vector=None, id=0, alignment_mode="strict", span_id=0): + def char_span(self, int start_idx, int end_idx, label=0, kb_id=0, vector=None, alignment_mode="strict", span_id=0): """Create a `Span` object from the slice `span.text[start : end]`. start (int): The index of the first character of the span. @@ -676,7 +676,6 @@ cdef class Span: kb_id (Union[int, str]): An ID from a KB to capture the meaning of a named entity. vector (ndarray[ndim=1, dtype='float32']): A meaning representation of the span. - id (Union[int, str]): Unused. alignment_mode (str): How character indices are aligned to token boundaries. Options: "strict" (character indices must be aligned with token boundaries), "contract" (span of all tokens completely diff --git a/website/docs/api/span.mdx b/website/docs/api/span.mdx index e62d9c724..7e7042866 100644 --- a/website/docs/api/span.mdx +++ b/website/docs/api/span.mdx @@ -193,7 +193,6 @@ the character indices don't map to a valid span. | `label` | A label to attach to the span, e.g. for named entities. ~~Union[int, str]~~ | | `kb_id` | An ID from a knowledge base to capture the meaning of a named entity. ~~Union[int, str]~~ | | `vector` | A meaning representation of the span. ~~numpy.ndarray[ndim=1, dtype=float32]~~ | -| `id` | Unused. ~~Union[int, str]~~ | | `alignment_mode` 3.5.1 | How character indices snap to token boundaries. Options: `"strict"` (no snapping), `"contract"` (span of all tokens completely within the character span), `"expand"` (span of all tokens at least partially covered by the character span). Defaults to `"strict"`. ~~str~~ | | `span_id` 3.5.1 | An identifier to associate with the span. ~~Union[int, str]~~ | | **RETURNS** | The newly constructed object or `None`. ~~Optional[Span]~~ |