RED-3133: Fixed bug in address combination rule

This commit is contained in:
deiflaender 2022-01-26 12:57:02 +01:00
parent 29ad27dea6
commit c21cf3dd5c

View File

@ -108,6 +108,12 @@ public class Section {
lastEnd = -1;
numberOfMatchParts = 0;
foundParts = new HashSet<>();
if(entity.getType().equals(startType)){
lastEnd = entity.getEnd();
start = entity.getStart();
foundParts.add(entity.getType());
numberOfMatchParts++;
}
} else if(entity.getType().equals(startType) && start != -1){
if(numberOfMatchParts >= minPartMatches) {
String value = searchText.substring(start, lastEnd);
@ -117,6 +123,8 @@ public class Section {
lastEnd = entity.getEnd();
numberOfMatchParts = 0;
foundParts = new HashSet<>();
foundParts.add(entity.getType());
numberOfMatchParts++;
} else if(start != -1 && combineSet.contains(entity.getType()) && entity.getStart() - lastEnd < maxDistanceBetween){
lastEnd = entity.getEnd();
numberOfMatchParts++;