|
@@ -16,7 +16,7 @@ public class AddressUtil {
|
|
|
private static final Pattern DISTRICT_PATTERN = Pattern.compile("(?<district>.+区|.+县|.+旗)");
|
|
|
private static final Pattern TOWN_PATTERN = Pattern.compile("(?<town>.+街道|.+镇|.+乡)");
|
|
|
private static final Pattern COMMUNITY_PATTERN = Pattern.compile("(?<community>.+社区|.+园区|.+村)");
|
|
|
- private static final Pattern ROAD_PATTERN = Pattern.compile("(?<road>.+路.+?段|.+路|.+巷|.+?街.+?段|.+?街|.+?道.+?段)");
|
|
|
+ private static final Pattern ROAD_PATTERN = Pattern.compile("(?<road>.+路.+?段|.+路|.+巷|.+?街.+?段|.+?街|.+?道.+?段|.+?道)");
|
|
|
private static final Pattern ROAD_NUMBER_PATTERN = Pattern.compile("(?<roadNumber>\\d+号附\\d+号|\\d+号)");
|
|
|
private static final Pattern BUILDING_PATTERN = Pattern.compile("(?<building>\\d+楼|\\d+栋|\\d+幢)");
|
|
|
private static final Pattern UNIT_PATTERN = Pattern.compile("(?<unit>\\d+单元)");
|
|
@@ -158,7 +158,7 @@ public class AddressUtil {
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- String location = "公平街办涌泉锦泉街98号锦里光华10栋2单元1层1号";
|
|
|
+ String location = "青羊区青羊大道8号12栋3单元11层A1号";
|
|
|
//String location = "成都市天府新区万安镇麓山大道二段20号附9号麓山国际3栋2单元2层3号住宅";
|
|
|
System.out.println(getRoadNumberAddress(location));
|
|
|
AddressDTO addressDTO = AddressUtil.parseAddress(location);
|