浏览代码

better checking for domains

George C. Privon 8 年之前
父节点
当前提交
139f5a97d5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      email_stats.py

+ 1 - 1
email_stats.py

@@ -77,7 +77,7 @@ for msg in a:
             senders[dateID] = np.zeros(len(domains) + 1)
         dmatch = False
         for i, domain in enumerate(domains):
-            if not(msg['To'] is None) and re.search(domain, msg['To']):
+            if not(msg['To'] is None) and re.search(domain + '\.', msg['To']):
                 senders[dateID][i+1] += 1
                 dmatch = True
         if not dmatch: