From b55df96f3a2d67ed75a8e5071ece505d225e6305 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 3 Dec 2020 12:42:12 +0000 Subject: [PATCH] Handle hashtag case --- utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index b90ce3dc..8fb392e9 100644 --- a/utils.py +++ b/utils.py @@ -113,7 +113,13 @@ def setHashtagCategory(baseDir: str, hashtag: str, category: str) -> bool: hashtagFilename = baseDir + '/tags/' + hashtag + '.txt' if not os.path.isfile(hashtagFilename): - return False + hashtag = hashtag.title() + hashtagFilename = baseDir + '/tags/' + hashtag + '.txt' + if not os.path.isfile(hashtagFilename): + hashtag = hashtag.upper() + hashtagFilename = baseDir + '/tags/' + hashtag + '.txt' + if not os.path.isfile(hashtagFilename): + return False categoryFilename = baseDir + '/tags/' + hashtag + '.category' with open(categoryFilename, 'w+') as fp: