From ebfa3c4d6ae44e9d783ff9fbc2c7bb14273b434d Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Fri, 9 Feb 2024 13:43:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E9=A2=98=E5=8F=B7.py=E4=B8=AD=E5=85=B3=E9=94=AE=E5=AD=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=95=99=E7=A9=BA,=20OBSOLETE=E6=94=BE?= =?UTF-8?q?=E5=85=A5=E5=88=B0=E4=BA=86=E7=A8=8B=E5=BA=8F=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/关键字筛选题号.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/工具v2/关键字筛选题号.py b/工具v2/关键字筛选题号.py index 69c1633e..27df45bb 100644 --- a/工具v2/关键字筛选题号.py +++ b/工具v2/关键字筛选题号.py @@ -1,10 +1,10 @@ keywords_dict = { "id":[""], #题号 - "content":["导数"], #题面内容 + "content":[""], #题面内容 "objs":[""], #目标代码 "tags":[""], #标签, 如["第二单元"]等 "genre":[""], #题目类型, 填空题, 选择题, 解答题 - "ans":[""], #答案 + "ans":[r""], #答案 "solution":[""], #解答与提示 "duration":[""], #解题时间(目前未设置) "usages":[""], #使用记录, 数据库中格式为 <日期>\t<届别><班别>\t正确率[\t正确率]... 例如"20230301\t2023届01班\t0.985\t0.211 @@ -16,7 +16,6 @@ keywords_dict = { "space":[""], #解答题下的空间(em)表示一个m的宽度 "unrelated":[""], #无关题目题号 # "content2":["双曲线"], #在字段名中加入数字表示这个字段的另一个必要条件 - "content_not":["OBSOLETE"], #加_not表示不能出现该样式的词 } #同一字段名中的条件为"或"的关系, 不同字段名(可加数字表示同一字段)中的条件为"且"的关系 outputfilepath = "临时文件/题号筛选.txt" @@ -26,6 +25,9 @@ from database_tools import * prodictpath = "../题库0.3/problems.json" pro_dict = load_dict(prodictpath) + +keywords_dict["content9_not"] = ["OBSOLETE"] +print(keywords_dict) matchlist = [id for id in pro_dict if MatchCondition(pro_dict[id],keywords_dict)] matchstring = generate_exp(matchlist)