From eadb220326c2dd754ccb624d77fbe4ae3687cb98 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Mon, 20 Mar 2023 13:52:59 +0000 Subject: [PATCH] Add exclude --- wd14-tagger/wd14tagger.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wd14-tagger/wd14tagger.py b/wd14-tagger/wd14tagger.py index 91521be..d6c69e4 100644 --- a/wd14-tagger/wd14tagger.py +++ b/wd14-tagger/wd14tagger.py @@ -93,10 +93,9 @@ elif valid: all = character + general remove = [s.strip() for s in exclude_tags.lower().split(",")] - all = [tag for tag in all if tag not in remove] + all = [tag for tag in all if tag[0] not in remove] - res = ", ".join((item[0].replace(" ", - "_").replace("(", "\\(").replace(")", "\\)") for item in all)) + res = ", ".join((item[0].replace("(", "\\(").replace(")", "\\)") for item in all)) print(res)