From 8a44b9780d8f3b3646d9a82fa437b0d4ca8f1ee4 Mon Sep 17 00:00:00 2001 From: zoujiwen Date: Mon, 16 Jun 2025 18:00:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20kg=5Flab=5F6.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.16 更新对于资源编码不能正确识别bug --- kg_lab_6.13/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kg_lab_6.13/utils.py b/kg_lab_6.13/utils.py index 4cc50c0..5f35c5a 100644 --- a/kg_lab_6.13/utils.py +++ b/kg_lab_6.13/utils.py @@ -37,7 +37,17 @@ def find_target_items(ele, input_str, data): result[0] = item["指标描述"]["指标映射"][0] return result + + +def is_yx_prefix(s): + import re + # 使用正则表达式检测是否以 'YX' 开头(可后跟任意字符) + return bool(re.match(r"^YX.*", s)) + + def judge_exists(input_str, data): + if is_yx_prefix(input_str): + return True for item in data: if isinstance(item["指标描述"], dict): if item["指标名称"] == input_str or item["指标描述"]["指标映射"][0] == input_str: