Detect full-width characters (mixed_unicode.py)

This commit is contained in:
jesopo 2018-11-20 12:00:47 +00:00
parent e54db0858c
commit 52d5b5da49

View file

@ -7,6 +7,7 @@ class Script(enum.Enum):
Cyrillic = 2 Cyrillic = 2
Greek = 3 Greek = 3
Armenian = 4 Armenian = 4
FullWidth = 5
WORD_SEPERATORS = [",", " ", "\t", "."] WORD_SEPERATORS = [",", " ", "\t", "."]
class Module(ModuleManager.BaseModule): class Module(ModuleManager.BaseModule):
@ -20,6 +21,8 @@ class Module(ModuleManager.BaseModule):
return Script.Cyrillic return Script.Cyrillic
elif 1329 <= point <= 1418: elif 1329 <= point <= 1418:
return Script.Armenian return Script.Armenian
elif 65281 <= point <= 65376:
return Script.FullWidth
return Script.Unknown return Script.Unknown
@utils.hook("received.message.channel") @utils.hook("received.message.channel")