Skip to content

Commit

Permalink
♻️ Refactor ContentTagger mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoPerrier committed Dec 5, 2024
1 parent cc197e3 commit 314e927
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion melusine/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 1 addition & 7 deletions melusine/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
----------
Expand Down

0 comments on commit 314e927

Please sign in to comment.