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