From e7f56372319bf4f275d2a74bbc78abb8bc485200 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Sat, 8 Jul 2023 17:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86detectmaxsim?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=A8=8D=E6=9C=89=E5=8A=A0=E9=80=9F?= =?UTF-8?q?,=20=E9=9C=80=E8=A6=81=E8=B0=83=E7=94=A8=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=BF=87=E7=9A=84=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/database_tools.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index 2324a945..85300af3 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -60,10 +60,9 @@ def treat_dict(p_dict): #对整个题库字典中的内容部分进行预处理 def detectmaxsim(currentid,excludelist,adict): #检测与已知题目关联程度最大的题目(除外列表之外的部分) maxsim = -1 argmaxsim = "000000" - treated_dict = treat_dict(adict) for id in adict: if not id in excludelist: - simrate = Levenshtein.jaro(treat_dict[id]["content"],treat_dict[currentid]["content"]) + simrate = Levenshtein.jaro(adict[id]["content"],adict[currentid]["content"]) if simrate > maxsim: maxsim = simrate argmaxsim = id