修复启动报错问题 (#247)

修复启动时SyntaxWarning: invalid escape sequence '\]'
  half_width_punctuations = '!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~'的报错问题
This commit is contained in:
vonweller 2025-03-09 00:35:36 +08:00 committed by GitHub
parent 06c5dba302
commit ec25c67fa3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,7 +75,7 @@ def get_string_no_punctuation_or_emoji(s):
def remove_punctuation_and_length(text):
# 全角符号和半角符号的Unicode范围
full_width_punctuations = '!"#$%&'()*+,-。/:;<=>?@[\]^_`{|}~'
half_width_punctuations = '!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~'
half_width_punctuations = r'!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~'
space = ' ' # 半角空格
full_width_space = ' ' # 全角空格