mirror of https://gitlab.com/bashrc2/epicyon
Exit loop if found
parent
8101835c05
commit
2048670417
|
@ -1023,6 +1023,7 @@ def _get_simplified_content(content: str) -> str:
|
||||||
def detect_dogwhistles(content: str, dogwhistles: {}) -> {}:
|
def detect_dogwhistles(content: str, dogwhistles: {}) -> {}:
|
||||||
"""Returns a dict containing any detected dogwhistle words
|
"""Returns a dict containing any detected dogwhistle words
|
||||||
"""
|
"""
|
||||||
|
content = remove_html(content)
|
||||||
result = {}
|
result = {}
|
||||||
words = _get_simplified_content(content).split(' ')
|
words = _get_simplified_content(content).split(' ')
|
||||||
for whistle, category in dogwhistles.items():
|
for whistle, category in dogwhistles.items():
|
||||||
|
@ -1078,6 +1079,7 @@ def detect_dogwhistles(content: str, dogwhistles: {}) -> {}:
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
result[whistle]['count'] += 1
|
result[whistle]['count'] += 1
|
||||||
|
break
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue