Maximum hashtag length within categories

merge-requests/9/merge
Bob Mottram 2021-01-24 10:45:35 +00:00
parent 89ad584eb8
commit 22a11acc35
1 changed files with 3 additions and 0 deletions

View File

@ -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()