更新分类题号字典生成功能, 并修复一个bug

This commit is contained in:
weiye.wang 2023-06-07 20:38:55 +08:00
parent 284535e6fc
commit 310b5ecee3
1 changed files with 2 additions and 3 deletions

View File

@ -1,13 +1,12 @@
original_id_list = "1:50000"
import re,json
suffix_words = ["试题"]
suffix_words = ["试题",r"第[\d]*题"]
def strip_suffix(problem, suf_words):
origin = problem["origin"]
for sw in suf_words:
if sw in origin:
origin = re.sub(sw+r"[\d]*$","",origin)
origin = re.sub(sw+r"[\S]*$","",origin)
return(origin)
def generate_number_set(string):