|
@@ -556,13 +556,13 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
public static Map<String, String> addressResolutionMap(String address) {
|
|
|
- String regex = "(?<town>[^区]+区|.+镇|.+乡)?(?<village>.[^村]+村|.+居委会|.+乡)";
|
|
|
+ String regex = "(?<town>[^区]+区|.+镇|.+乡)?(?<village>.[^村]+村|.+村委会|.+乡)";
|
|
|
Matcher m = Pattern.compile(regex).matcher(address);
|
|
|
String province = null, city = null, county = null, town = null, village = null;
|
|
|
List<Map<String, String>> table = new ArrayList<Map<String, String>>();
|
|
|
Map<String, String> row = null;
|
|
|
String result = null;
|
|
|
- while (m.find()) {
|
|
|
+ if (m.find()) {
|
|
|
row = new LinkedHashMap<String, String>();
|
|
|
town = m.group("town");
|
|
|
row.put("town", town == null ? "" : town.trim());
|