Browse Source

plus d'insultes et fix regex

pull/3/head
Figg 8 months ago
parent
commit
2862ba1a3a
2 changed files with 15 additions and 2 deletions
  1. 1
    1
      million/analyze/wordFinder.py
  2. 14
    1
      scripts/find_gromots.py

+ 1
- 1
million/analyze/wordFinder.py View File

@@ -5,7 +5,7 @@ from million.model.message import Message
5 5
 
6 6
 def _wordFilter(msg: Message, regexs: List[str]) -> bool:
7 7
     return msg.content and any(
8
-        re.search(rgx, msg.content) for rgx in regexs
8
+        re.search(rgx, msg.content, re.I) for rgx in regexs
9 9
         )
10 10
 
11 11
 def findWords(messages: List[Message], words: List[str]) -> List[Message]:

+ 14
- 1
scripts/find_gromots.py View File

@@ -9,7 +9,20 @@ parser = FacebookExportParser()
9 9
 
10 10
 export = parser.parse(DATA_PATH)
11 11
 
12
-gros_mots = ['merde', 'sexe', 'pute', 'putain', 'bite', 'nichon', 'con(ne)?', 'baiser?']
12
+gros_mots = [
13
+    '.*merde.*',
14
+    'sexe',
15
+    'pute',
16
+    'pé?dé?',
17
+    'putain',
18
+    'bite',
19
+    'encul.*',
20
+    'cul',
21
+    'nichon',
22
+    'con(ne)?',
23
+    'bais.*'
24
+    ]
25
+
13 26
 msg_gros_mots = findWords(export.messages, gros_mots)
14 27
 
15 28
 msg_gros_mots_grp = {}

Loading…
Cancel
Save