优化匹配BUG
This commit is contained in:
@@ -397,6 +397,7 @@ public class Address {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setOrgAddress(String orgAddress) {
|
public void setOrgAddress(String orgAddress) {
|
||||||
|
orgAddress = orgAddress.toUpperCase();
|
||||||
setAddress(orgAddress);
|
setAddress(orgAddress);
|
||||||
if(this.orgAddress != null){
|
if(this.orgAddress != null){
|
||||||
throw new UnsupportedOperationException("原始地址不能被修改");
|
throw new UnsupportedOperationException("原始地址不能被修改");
|
||||||
|
|||||||
+2
-2
@@ -70,9 +70,9 @@ public class KeywordProcessor extends AbstractAddressProcessor {
|
|||||||
|
|
||||||
if(StringUtils.isNotBlank(address.getAddress())){
|
if(StringUtils.isNotBlank(address.getAddress())){
|
||||||
if(address.getOrgAddress().indexOf(sb.toString()) >= address.getOrgAddress().indexOf(address.getAddress())){
|
if(address.getOrgAddress().indexOf(sb.toString()) >= address.getOrgAddress().indexOf(address.getAddress())){
|
||||||
sb.insert(0, address.getAddress());
|
|
||||||
}else{
|
|
||||||
sb.append(address.getAddress());
|
sb.append(address.getAddress());
|
||||||
|
}else{
|
||||||
|
sb.insert(0, address.getAddress());
|
||||||
}
|
}
|
||||||
String kw = fetchKeywords(address.getAddress());
|
String kw = fetchKeywords(address.getAddress());
|
||||||
if(StringUtils.isNotBlank(kw)){
|
if(StringUtils.isNotBlank(kw)){
|
||||||
|
|||||||
+8
-2
@@ -23,11 +23,17 @@ public class StageAndPartitionProcessor extends AbstractAddressProcessor {
|
|||||||
addr = addr.replaceAll(matchResult.matchContent, formatStage);
|
addr = addr.replaceAll(matchResult.matchContent, formatStage);
|
||||||
address.setAddress(addr);
|
address.setAddress(addr);
|
||||||
}
|
}
|
||||||
address.setStage(matchResult.matchContent);
|
address.setStage(formatStage);
|
||||||
}
|
}
|
||||||
matchResult = matchFirst(AddressParserPatterns.PARTITION_PATTERN, orgAddr);
|
matchResult = matchFirst(AddressParserPatterns.PARTITION_PATTERN, orgAddr);
|
||||||
if (matchResult != null) {
|
if (matchResult != null) {
|
||||||
address.setPartition(matchResult.matchContent);
|
String formatPartition = CNNMFilter.convertArabicToCnNumeric(matchResult.matchContent);
|
||||||
|
if(!formatPartition.equals(matchResult.matchContent)){
|
||||||
|
String addr = address.getAddress();
|
||||||
|
addr = addr.replaceAll(matchResult.matchContent, formatPartition);
|
||||||
|
address.setAddress(addr);
|
||||||
|
}
|
||||||
|
address.setStage(formatPartition);
|
||||||
}
|
}
|
||||||
return RepeatStatus.NEXT;
|
return RepeatStatus.NEXT;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user