|
@@ -53,7 +53,7 @@ public class ShanghaiAddressSplitUtil {
|
|
|
|
|
|
|
|
private static final Pattern MULTI_ADDRESS = Pattern.compile("(?<=[0-9])[号弄]?[、/\\\\][0-9]+(?=[号弄])");
|
|
private static final Pattern MULTI_ADDRESS = Pattern.compile("(?<=[0-9])[号弄]?[、/\\\\][0-9]+(?=[号弄])");
|
|
|
|
|
|
|
|
- private static Map<String, String> errAddrReStr = new HashMap<>();
|
|
|
|
|
|
|
+ public static Map<String, String> errAddrReStr = new HashMap<>();
|
|
|
|
|
|
|
|
@PostConstruct
|
|
@PostConstruct
|
|
|
private void init() {
|
|
private void init() {
|
|
@@ -89,6 +89,7 @@ public class ShanghaiAddressSplitUtil {
|
|
|
errAddrReStr.put("李塔汇镇", "石湖荡镇");
|
|
errAddrReStr.put("李塔汇镇", "石湖荡镇");
|
|
|
errAddrReStr.put("大港镇", "小昆山镇");
|
|
errAddrReStr.put("大港镇", "小昆山镇");
|
|
|
errAddrReStr.put("天马山镇", "佘山镇");
|
|
errAddrReStr.put("天马山镇", "佘山镇");
|
|
|
|
|
+ errAddrReStr.put("江海镇", "南桥镇");
|
|
|
Map<String, threeLevelAddress> districtMap = new HashMap<>();
|
|
Map<String, threeLevelAddress> districtMap = new HashMap<>();
|
|
|
Map<String, List<threeLevelAddress>> streetMap = new HashMap<>();
|
|
Map<String, List<threeLevelAddress>> streetMap = new HashMap<>();
|
|
|
Map<String, List<threeLevelAddress>> communityMap = new HashMap<>();
|
|
Map<String, List<threeLevelAddress>> communityMap = new HashMap<>();
|
|
@@ -586,7 +587,7 @@ public class ShanghaiAddressSplitUtil {
|
|
|
new ShanghaiAddressSplitUtil().init();
|
|
new ShanghaiAddressSplitUtil().init();
|
|
|
AddrSplitLmrMap addrSplitLmrMap = new AddrSplitLmrMap();
|
|
AddrSplitLmrMap addrSplitLmrMap = new AddrSplitLmrMap();
|
|
|
addrSplitLmrMap.initFile();
|
|
addrSplitLmrMap.initFile();
|
|
|
- String testAddress = "上海市长宁区仙霞新村街道仙霞街道外来人员管理办公室";
|
|
|
|
|
|
|
+ String testAddress = "上海市崇明区港西镇三双公路1021号10幢U1006室(上海津桥经济开发区)";
|
|
|
System.out.println("测试地址:" + testAddress);
|
|
System.out.println("测试地址:" + testAddress);
|
|
|
SplitAddress xzqh = splitBestAddress(testAddress);
|
|
SplitAddress xzqh = splitBestAddress(testAddress);
|
|
|
System.out.println(xzqh);
|
|
System.out.println(xzqh);
|