From 310b5ecee3b32d9c33a98c8102c998f834d58186 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Wed, 7 Jun 2023 20:38:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=86=E7=B1=BB=E9=A2=98?= =?UTF-8?q?=E5=8F=B7=E5=AD=97=E5=85=B8=E7=94=9F=E6=88=90=E5=8A=9F=E8=83=BD?= =?UTF-8?q?,=20=E5=B9=B6=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具/分类题号字典生成.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/工具/分类题号字典生成.py b/工具/分类题号字典生成.py index cf1b4288..cd58e67e 100644 --- a/工具/分类题号字典生成.py +++ b/工具/分类题号字典生成.py @@ -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):