File size: 617 Bytes
4e0f321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()