Files
_Geulbeot/02. Prompts/문서생성/codedomain/단위일_가능성_Python_v01.py

20 lines
617 B
Python

def is_likely_unit(cell_val):
"""단위일 가능성 판별 (사용자 제안 로직)"""
if not cell_val:
return False
val = str(cell_val).strip()
# 1. 빈 값 또는 너무 긴 텍스트 (단위는 보통 6자 이내)
if not val or len(val) > 6:
return False
# 2. 순수 숫자는 제외
cleaned = val.replace('.', '').replace(',', '').replace('-', '').replace(' ', '')
if cleaned.isdigit():
return False
# 3. 수식은 제외
if val.startswith('='):
return False
# 4. 일반적인 계산 기호 및 정크 기호 제외