修复启动报错问题

修复启动时SyntaxWarning: invalid escape sequence '\]'
  half_width_punctuations = '!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~'的报错问题
This commit is contained in:
vonweller 2025-03-08 19:09:43 +08:00
parent 07fe330e4f
commit 79b46ed533

View file

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