vos-data-utils 1.0.8__py3-none-any.whl → 1.0.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vdutils/genpnu.py CHANGED
@@ -229,8 +229,11 @@ class GenPnu():
229
229
  if not isinstance(bjd_nm, str):
230
230
  raise TypeError("type of object('bjd_nm') must be string")
231
231
 
232
- if not re.match("^[가-힣0-9 ]+$", bjd_nm):
233
- raise ValueError("object('bjd_nm') should consist of only Korean characters and numbers")
232
+ # 한자 표기가 포함된 괄호도 허용하도록 정규식 수정
233
+ # 한자 범위: \u4e00-\u9fff (CJK Unified Ideographs)
234
+ # if not re.match("^[가-힣0-9]+$", bjd_nm):
235
+ if not re.match("^[가-힣0-9 ()\u4e00-\u9fff]+$", bjd_nm): # NOTE 한자 표기 괄호 허용
236
+ raise ValueError("object('bjd_nm') should consist of only Korean characters, numbers, and Chinese characters in parentheses")
234
237
 
235
238
  not_a_valid_district_response: Dict[str, Any] = {
236
239
  "error": True,
@@ -727,8 +730,11 @@ class GenPnu():
727
730
  if not isinstance(jibun, str):
728
731
  raise TypeError("type of object('jibun') must be string")
729
732
 
730
- if not re.match("^[가-힣0-9 ]+$", bjd_nm):
731
- raise ValueError("object('bjd_nm') should consist of only Korean characters and numbers")
733
+ # 한자 표기가 포함된 괄호도 허용하도록 정규식 수정
734
+ # 한자 범위: \u4e00-\u9fff (CJK Unified Ideographs)
735
+ # if not re.match("^[가-힣0-9]+$", bjd_nm):
736
+ if not re.match("^[가-힣0-9 ()\u4e00-\u9fff]+$", bjd_nm):
737
+ raise ValueError("object('bjd_nm') should consist of only Korean characters, numbers, and Chinese characters in parentheses")
732
738
 
733
739
  try:
734
740
  res = self.get_bjd_cd(bjd_nm=bjd_nm)