dongzhaorui 3 年之前
父节点
当前提交
c61f54d945
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      find_source/crawler/utils.py

+ 7 - 0
find_source/crawler/utils.py

@@ -57,3 +57,10 @@ def is_domain(domain):
         r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'  # ...or ip
         r'(?::\d+)?', re.IGNORECASE)
     return re.match(_regex, domain) is not None
+
+
+def label_split(val):
+    '~`!#$%^&*()_+-=|\';"":/.,?><~·!@#¥%……&*()——+-=“:’;、。,?》{《}】【\n\]\[ '
+    result = re.split(r'[- _,,\\.|-「」【】??!!/、] *', val)
+    result = [v for v in result if len(v) > 0]
+    return result