Merge remote-tracking branch 'origin/sub_laptop_1' into sub_laptop_2
# Conflicts: # resources/master_data/로직_건설품셈_공통8장.json # resources/master_data/재료_자체.json
This commit is contained in:
@@ -139,7 +139,10 @@ class _Parser:
|
||||
elif head:
|
||||
pass
|
||||
elif depth == 0 and ch == "." and not self.s[self.i + 1 : self.i + 2].isdigit():
|
||||
break
|
||||
# 「K.P」「T.S」 처럼 영문자 사이 점은 열쇠 글자
|
||||
around = self.s[self.i - 1 : self.i + 2 : 2]
|
||||
if not (len(around) == 2 and around.isascii() and around.isalpha()):
|
||||
break
|
||||
elif depth == 0 and re.match(r"\s[-+*/<>=!]", self.s[self.i : self.i + 2]):
|
||||
break
|
||||
self.i += 1
|
||||
@@ -262,6 +265,9 @@ def _match(table: dict, row: dict, cond: str, want) -> bool:
|
||||
if table.get("조건", {}).get(cond) == "범위":
|
||||
low, high = have
|
||||
rule, *more = table.get("범위규칙", "초과·이하").split(" · ")
|
||||
rule = rule.split(" (")[0] # 「이상·미만 (원문 …)」 — 괄호 설명은 뺌
|
||||
if rule == "이상·이하":
|
||||
return (low is None or want >= low) and (high is None or want <= high)
|
||||
if rule == "초과·이하":
|
||||
return (low is None or want > low) and (high is None or want <= high)
|
||||
if rule == "이상·미만":
|
||||
|
||||
Reference in New Issue
Block a user