From 8ac71f040277cb09a13325fb77047703f37a17bf Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Wed, 10 Aug 2022 11:44:05 +0200 Subject: [PATCH] Rename modules for consistency (#11286) * rename Python module to entity_ruler * rename Python module to attribute_ruler --- spacy/pipeline/__init__.py | 6 +++--- spacy/pipeline/{attributeruler.py => attribute_ruler.py} | 0 spacy/pipeline/{entityruler.py => entity_ruler.py} | 0 website/docs/api/attributeruler.mdx | 6 +++--- website/docs/api/entityruler.mdx | 6 +++--- website/docs/usage/saving-loading.mdx | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename spacy/pipeline/{attributeruler.py => attribute_ruler.py} (100%) rename spacy/pipeline/{entityruler.py => entity_ruler.py} (100%) diff --git a/spacy/pipeline/__init__.py b/spacy/pipeline/__init__.py index 2c4a5a8a87f..82d24486a27 100644 --- a/spacy/pipeline/__init__.py +++ b/spacy/pipeline/__init__.py @@ -1,9 +1,9 @@ -from .attributeruler import AttributeRuler +from .attribute_ruler import AttributeRuler from .dep_parser import DependencyParser from .edit_tree_lemmatizer import EditTreeLemmatizer from .entity_linker import EntityLinker -from .entityruler import EntityRuler -from .functions import merge_entities, merge_noun_chunks, merge_subtokens +from .ner import EntityRecognizer +from .entity_ruler import EntityRuler from .lemmatizer import Lemmatizer from .morphologizer import Morphologizer from .ner import EntityRecognizer diff --git a/spacy/pipeline/attributeruler.py b/spacy/pipeline/attribute_ruler.py similarity index 100% rename from spacy/pipeline/attributeruler.py rename to spacy/pipeline/attribute_ruler.py diff --git a/spacy/pipeline/entityruler.py b/spacy/pipeline/entity_ruler.py similarity index 100% rename from spacy/pipeline/entityruler.py rename to spacy/pipeline/entity_ruler.py diff --git a/website/docs/api/attributeruler.mdx b/website/docs/api/attributeruler.mdx index c1831918752..e8cb248f85b 100644 --- a/website/docs/api/attributeruler.mdx +++ b/website/docs/api/attributeruler.mdx @@ -1,8 +1,8 @@ --- title: AttributeRuler tag: class -source: spacy/pipeline/attributeruler.py -version: 3 +source: spacy/pipeline/attribute_ruler.py +new: 3 teaser: 'Pipeline component for rule-based token attribute assignment' api_string_name: attribute_ruler api_trainable: false @@ -34,7 +34,7 @@ how the component should be configured. You can override its settings via the | `validate` | Whether patterns should be validated (passed to the `Matcher`). Defaults to `False`. ~~bool~~ | ```python -%%GITHUB_SPACY/spacy/pipeline/attributeruler.py +%%GITHUB_SPACY/spacy/pipeline/attribute_ruler.py ``` ## AttributeRuler.\_\_init\_\_ {id="init",tag="method"} diff --git a/website/docs/api/entityruler.mdx b/website/docs/api/entityruler.mdx index 335e87676c7..67a709a276b 100644 --- a/website/docs/api/entityruler.mdx +++ b/website/docs/api/entityruler.mdx @@ -1,8 +1,8 @@ --- title: EntityRuler tag: class -source: spacy/pipeline/entityruler.py -version: 2.1 +source: spacy/pipeline/entity_ruler.py +new: 2.1 teaser: 'Pipeline component for rule-based named entity recognition' api_string_name: entity_ruler api_trainable: false @@ -65,7 +65,7 @@ how the component should be configured. You can override its settings via the | `scorer` | The scoring method. Defaults to [`spacy.scorer.get_ner_prf`](/api/scorer#get_ner_prf). ~~Optional[Callable]~~ | ```python -%%GITHUB_SPACY/spacy/pipeline/entityruler.py +%%GITHUB_SPACY/spacy/pipeline/entity_ruler.py ``` ## EntityRuler.\_\_init\_\_ {id="init",tag="method"} diff --git a/website/docs/usage/saving-loading.mdx b/website/docs/usage/saving-loading.mdx index 0b0b759e914..8ca46a334a4 100644 --- a/website/docs/usage/saving-loading.mdx +++ b/website/docs/usage/saving-loading.mdx @@ -189,7 +189,7 @@ the data to and from a JSON file. > > To see custom serialization methods in action, check out the new > [`EntityRuler`](/api/entityruler) component and its -> [source](%%GITHUB_SPACY/spacy/pipeline/entityruler.py). Patterns added to the +> [source](%%GITHUB_SPACY/spacy/pipeline/entity_ruler.py). Patterns added to the > component will be saved to a `.jsonl` file if the pipeline is serialized to > disk, and to a bytestring if the pipeline is serialized to bytes. This allows > saving out a pipeline with a rule-based entity recognizer and including all