from src.rule_based_system.Rule import Rule | |
class LanguageRule(Rule): | |
def get_verdict(self, comment_text: str) -> bool: | |
""" | |
This rule requires further research. The library "langdetect" allows for language detection, | |
but when applied to jeugdjournaal comments returns unstable results. | |
A simpler approach could be by checking the percentage of non latin characters, | |
but not taking into account smileys and punctuation | |
""" | |
raise NotImplementedError() | |
def is_strict(self) -> bool: | |
return False | |
language_rule = LanguageRule() | |