diff --git a/categories.py b/categories.py index 5b1445d9d..2ca2ed4a3 100644 --- a/categories.py +++ b/categories.py @@ -32,6 +32,7 @@ def getHashtagCategory(baseDir: str, hashtag: str) -> str: def getHashtagCategories(baseDir: str, recent=False, category=None) -> None: """Returns a dictionary containing hashtag categories """ + maxTagLength = 42 hashtagCategories = {} if recent: @@ -47,6 +48,8 @@ def getHashtagCategories(baseDir: str, recent=False, category=None) -> None: if not os.path.isfile(categoryFilename): continue hashtag = f.split('.')[0] + if len(hashtag) > maxTagLength: + continue with open(categoryFilename, 'r') as fp: categoryStr = fp.read()