From 16686ce3c445518f13e31a01a8d3561f77515519 Mon Sep 17 00:00:00 2001 From: Jianqi Pan Date: Tue, 25 Jun 2024 00:38:14 +0900 Subject: [PATCH] feat(result): return all tags --- wdtagger/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wdtagger/__init__.py b/wdtagger/__init__.py index 798c1ce..3e47494 100644 --- a/wdtagger/__init__.py +++ b/wdtagger/__init__.py @@ -162,6 +162,15 @@ class Result: string = [x[0] for x in string] return ", ".join(string) + @property + def all_tags(self) -> list[str]: + """Return all tags as a list.""" + return [self.rating] + list(self.general_tags) + list(self.character_tags) + + @property + def all_tags_string(self) -> str: + return ", ".join(self.all_tags) + def __str__(self) -> str: """Return a formatted string representation of the tags and their ratings."""