aboutsummaryrefslogtreecommitdiff
path: root/modules/words.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-11 13:04:54 +0100
committerGravatar jesopo2018-10-11 13:04:54 +0100
commit2c815f4bbc29ea46244e4b731349e0ed3bd22f11 (patch)
tree33227a4f09e519d0adea37f6992d725c0ec8facb /modules/words.py
parentAlso strip "." from the end of words in modules/words.py (diff)
signature
Strip specific characters from the front of words too (and add more characters
to strip from the end) in modules/words.py
Diffstat (limited to 'modules/words.py')
-rw-r--r--modules/words.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/words.py b/modules/words.py
index 1ad964c3..8982326c 100644
--- a/modules/words.py
+++ b/modules/words.py
@@ -1,7 +1,8 @@
import time
from src import EventManager, ModuleManager, utils
-WORD_STOP = ";:.,!?~"
+WORD_START = "\"“'({<…"
+WORD_STOP = "\"”')}>;:.,!?~…"
class Module(ModuleManager.BaseModule):
def _channel_message(self, user, event):
@@ -20,7 +21,7 @@ class Module(ModuleManager.BaseModule):
tracked_words = set(event["server"].get_setting(
"tracked-words", []))
for word in words:
- word = word.rstrip(WORD_STOP)
+ word = word.lstrip(WORD_START).rstrip(WORD_STOP)
if word.lower() in tracked_words:
setting = "word-%s" % word
word_count = user.get_setting(setting, 0)