From 314e92772b10fdedc3092cc96c1cf03febc28b70 Mon Sep 17 00:00:00 2001 From: Hugo Perrier Date: Thu, 5 Dec 2024 17:30:14 +0100 Subject: [PATCH] :recycle: Refactor ContentTagger mechanism --- melusine/message.py | 2 +- melusine/processors.py | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/melusine/message.py b/melusine/message.py index 2fc30a0..bcac579 100644 --- a/melusine/message.py +++ b/melusine/message.py @@ -139,7 +139,7 @@ def extract_last_body( self, target_tags: Iterable[str] = ("BODY",), stop_at: Iterable[str] = ("GREETINGS",), - tag_type: str = MAIN_TAG_TYPE + tag_type: str = MAIN_TAG_TYPE, ) -> List[Dict[str, Any]]: """ Extract the BODY parts of the last message in the email. diff --git a/melusine/processors.py b/melusine/processors.py index 325d16f..5bd8f4f 100644 --- a/melusine/processors.py +++ b/melusine/processors.py @@ -1163,7 +1163,6 @@ def find_matching_regex_patterns(self, part: str, regex: TagPattern) -> list[str return matching_regex_list - class ContentTagger(BaseContentTagger): """ Class to add tags to a text. @@ -1553,12 +1552,7 @@ class RefinedTagger(MelusineTransformer): BASE_TAG_KEY = "base_tag" REFINED_TAG_KEY = "refined_tag" - def __init__( - self, - input_columns: str = "messages", - output_columns: str = "messages", - default_tag: str = "BODY" - ): + def __init__(self, input_columns: str = "messages", output_columns: str = "messages", default_tag: str = "BODY"): """ Parameters ----------