vos-data-utils 1.0.6__py3-none-any.whl → 1.0.7__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/library/data.py CHANGED
@@ -1,9 +1,22 @@
1
+ import re
1
2
  from typing import (
2
3
  List,
3
4
  Dict
4
5
  )
5
6
 
6
7
 
8
+ ETC_LAND_PATTERN: re.Pattern = r'\d+-?\d*\s?외\s?\d*'
9
+
10
+ ETC_LAND_PATTERN_FOR_SPLIT: re.Pattern = r'외\s*\d+\s*필지'
11
+
12
+ LOAD_PATTERN: re.Pattern = r'((?:\S*\s+)?(?:길|로)\s*\S*\s*(?:\d+(?:-\d+)?)\s*(?:외\s*\d+필지)?\s*)'
13
+
14
+ JIBUN_PATTERN: re.Pattern = r'((?:\S*\s+)?(?:동|리|가|로)\s*\S*\s*(?:\d+(?:-\d+)?)\s*(?:외\s*\d+필지)?\s*)'
15
+
16
+ LOAD_PATTERN_FOR_SLICE: re.Pattern = r'((?:\S+\s+)*?\S*(?:길)\b\s*\S*\s*(?:\d+(?:-\d+)?)\s*)'
17
+
18
+ JIBUN_PATTERN_FOR_SLICE: re.Pattern = r'((?:\S+\s+)*?(?:\S+(?:시|도)\s+)?\S*(?:동|리|가|로)\b\s*\S*\s*(?:\d{1,4}(?:-\d{1,4})\b)?)'
19
+
7
20
  ADD_BJD_CHANGED_DICTIONARY: Dict[str, str] = {
8
21
  # 법정동코드 : 과거 법정동코드
9
22
  "4812110100": "4811010100", # 경상남도 창원시 북동 -> 경상남도 창원시 의창구 북동
@@ -1938,4 +1951,4 @@ LAST_NM_REFINE_MAP: Dict[str, str] = {
1938
1951
  "대율리": "대률리",
1939
1952
  "어용리": "어룡리",
1940
1953
  "청룡리": "청용리",
1941
- }
1954
+ }
@@ -57,12 +57,46 @@ class TestClass(unittest.TestCase):
57
57
  def test_runs(self):
58
58
  """단순 실행여부 판별하는 테스트 메소드"""
59
59
 
60
+ self.instance.replace_etc_land_string(addr=self.addr_1)
60
61
  self.instance.correct_simple_spacing(addr=self.addr_1)
61
62
  self.instance.correct_smallest_bjd_spacing(addr=self.addr_1)
62
63
  self.instance.correct_changed_bjd(addr=self.addr_1, is_log=True)
63
64
  self.instance.correct_bjd(addr=self.addr_1, is_log=True)
64
65
 
65
66
 
67
+ def test_replace_etc_land_string(self):
68
+ """replace_etc_land_string 함수 테스트 메소드"""
69
+
70
+ with self.assertRaises(TypeError):
71
+ self.instance.replace_etc_land_string(0)
72
+
73
+ with self.assertRaises(TypeError):
74
+ self.instance.replace_etc_land_string(None)
75
+
76
+ with self.assertRaises(TypeError):
77
+ self.instance.replace_etc_land_string(False)
78
+
79
+ res = self.instance.replace_etc_land_string('서울시 강남구 삼성동 1외')
80
+ self.assertTrue(res, str)
81
+ self.assertEqual(res, '서울시 강남구 삼성동 1 외')
82
+
83
+ res = self.instance.replace_etc_land_string('서울시 강남구 삼성동 1외1')
84
+ self.assertTrue(res, str)
85
+ self.assertEqual(res, '서울시 강남구 삼성동 1 외1')
86
+
87
+ res = self.instance.replace_etc_land_string('서울시 강남구 삼성동 1외 1')
88
+ self.assertTrue(res, str)
89
+ self.assertEqual(res, '서울시 강남구 삼성동 1 외 1')
90
+
91
+ res = self.instance.replace_etc_land_string('서울시 강남구 삼성동 1외1필지')
92
+ self.assertTrue(res, str)
93
+ self.assertEqual(res, '서울시 강남구 삼성동 1 외1필지')
94
+
95
+ res = self.instance.replace_etc_land_string('서울시 강남구 삼성동 1외 1필지')
96
+ self.assertTrue(res, str)
97
+ self.assertEqual(res, '서울시 강남구 삼성동 1 외 1필지')
98
+
99
+
66
100
  def test_correct_simple_spacing(self):
67
101
  """correct_simple_spacing 함수 테스트 메소드"""
68
102