Score mixed unicode as a percentage (mixed_unicode.py)
This commit is contained in:
parent
727ade4022
commit
c59a5600a8
1 changed files with 3 additions and 0 deletions
|
@ -13,6 +13,8 @@ class Script(enum.Enum):
|
|||
TaiLe = 8
|
||||
WORD_SEPERATORS = [",", " ", "\t", "."]
|
||||
|
||||
SCORE_LENGTH = 100
|
||||
|
||||
class Module(ModuleManager.BaseModule):
|
||||
def _detect_script(self, char):
|
||||
point = ord(char)
|
||||
|
@ -63,5 +65,6 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
last_was_separator = False
|
||||
|
||||
score = score/(len(event["message"])/SCORE_LENGTH)
|
||||
if score > 0:
|
||||
self.log.trace("Message given a mixed-unicode score of %d", [score])
|
||||
|
|
Loading…
Reference in a new issue