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