Fix #2178 incorrect processing of some addresses in krzip module

This commit is contained in:
Kijin Sung 2023-09-06 16:32:03 +09:00
parent a99f56c7bc
commit 4ccfaad75e
2 changed files with 14 additions and 10 deletions

View file

@ -61,21 +61,21 @@ class krzipModel extends krzip
}
/* 지번 주소 */
if(preg_match('/\(.+\s.+[읍면동리(마을)(0-9+가)]\s[0-9-]+\)/', $output[1], $matches))
if(preg_match('/\(.+\s\S+[읍면동리(마을)(0-9+가)]\s[0-9-]+\)/us', $output[1], $matches))
{
$output[1] = trim(str_replace($matches[0], '', $output[1]));
$output[2] = $matches[0];
}
/* 부가 정보 */
if(preg_match('/\(.+[읍면동리(마을)(0-9+가)](?:,.*)?\)/u', $output[1], $matches))
if(preg_match('/\(\S+[읍면동리(마을)(0-9+가)](?:,.*)?\)/us', $output[1], $matches))
{
$output[1] = trim(str_replace($matches[0], '', $output[1]));
$output[4] = $matches[0];
}
/* 상세 주소 */
if(preg_match('/^(.+ [가-힝]+[0-9]*[동리로길]\s*[0-9-]+(?:번지?)?),?\s+(.+)$/u', $output[1], $matches))
if(preg_match('/^(.+ [가-힝A-Za-z0-9.·-]+(?:[동리로]|번?안?길)\s*[0-9-]+(?:번지?)?),?\s+(.+)$/us', $output[1], $matches))
{
$output[1] = trim($matches[1]);
$output[3] = trim($matches[2]);

View file

@ -65,16 +65,20 @@
/* 예상 주소 저장 */
ui.guide.hide().html("");
if(response.autoRoadAddress) {
var expRoadAddr = (response.autoRoadAddress + extraRoadAddr);
ui.guide
.html("(" + xe.lang.msg_krzip_road_address_expectation.replace("%s", expRoadAddr) + ")")
.show();
var expRoadAddr = response.autoRoadAddress;
if (expRoadAddr && !roadAddr) {
ui.roadAddress.val(expRoadAddr).trigger("change");
} else {
ui.guide.html("(" + xe.lang.msg_krzip_road_address_expectation.replace("%s", expRoadAddr) + ")").show();
}
}
else if(response.autoJibunAddress) {
var expJibunAddr = response.autoJibunAddress;
ui.guide
.html("(" + xe.lang.msg_krzip_jibun_address_expectation.replace("%s", expJibunAddr) + ")")
.show();
if (expJibunAddr && !jibunAddr) {
ui.jibunAddress.val("(" + expJibunAddr + ")").trigger("change");
} else {
ui.guide.html("(" + xe.lang.msg_krzip_jibun_address_expectation.replace("%s", expJibunAddr) + ")").show();
}
}
/* 상세 주소로 커서 이동 */