RED-10200: fix failing acceptance, function tests

This commit is contained in:
maverickstuder 2024-12-03 15:19:00 +01:00
parent bd97e60e0f
commit ef06d45efe
25 changed files with 147 additions and 129 deletions

View File

@ -4,12 +4,14 @@ import static java.lang.String.format;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
import com.iqser.red.service.redaction.v1.server.model.document.entity.Containment;
import com.iqser.red.service.redaction.v1.server.model.document.entity.EntityType;
import com.iqser.red.service.redaction.v1.server.model.document.entity.Equality;
import com.iqser.red.service.redaction.v1.server.model.document.entity.Intersection;
import com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity;
@ -373,21 +375,27 @@ public class DocumentTree {
EntityCreationUtility.addToPages(entity);
EntityCreationUtility.addEntityToNodeEntitySets(entity);
if (entity.getEntityType().equals(EntityType.TEMPORARY)) {
return;
}
for (TextEntity textEntity : entity.getDeepestFullyContainingNode().getEntities()) {
if (entity.intersects(textEntity) && !entity.equals(textEntity)) {
if (entity.intersects(textEntity) && !entity.equals(textEntity) && !textEntity.getEntityType().equals(EntityType.TEMPORARY)) {
if (textEntity.getTextRange().equals(entity.getTextRange())) {
textEntity.getRelations().put(textEntity, new Equality(entity, textEntity));
entity.getRelations().put(textEntity, new Equality(textEntity, entity));
textEntity.getRelations().computeIfAbsent(textEntity, k -> new HashSet<>()).add(new Equality(entity, textEntity));
entity.getRelations().computeIfAbsent(textEntity, k -> new HashSet<>()).add(new Equality(textEntity, entity));
} else if (textEntity.containedBy(entity)) {
entity.getRelations().put(textEntity, new Containment(entity, textEntity));
textEntity.getRelations().put(entity, new Intersection(textEntity, entity));
entity.getRelations().computeIfAbsent(textEntity, k -> new HashSet<>()).add(new Containment(entity, textEntity));
textEntity.getRelations().computeIfAbsent(entity, k -> new HashSet<>()).add(new Intersection(textEntity, entity));
} else if (entity.containedBy(textEntity)) {
textEntity.getRelations().put(entity, new Containment(textEntity, entity));
entity.getRelations().put(textEntity, new Intersection(entity, textEntity));
textEntity.getRelations().computeIfAbsent(entity, k -> new HashSet<>()).add(new Containment(textEntity, entity));
entity.getRelations().computeIfAbsent(textEntity, k -> new HashSet<>()).add(new Intersection(entity, textEntity));
} else {
entity.getRelations().put(textEntity, new Intersection(entity, textEntity));
textEntity.getRelations().put(entity, new Intersection(textEntity, entity));
entity.getRelations().computeIfAbsent(textEntity, k -> new HashSet<>()).add(new Intersection(entity, textEntity));
textEntity.getRelations().computeIfAbsent(entity, k -> new HashSet<>()).add(new Intersection(textEntity, entity));
}
}
}
}

View File

@ -10,4 +10,11 @@ public abstract class AbstractRelation implements Relation {
protected final TextEntity a;
protected final TextEntity b;
@Override
public String toString() {
return this.getClass().getSimpleName() + "{" + "a=" + a + ", b=" + b + '}';
}
}

View File

@ -6,5 +6,6 @@ public enum EntityType {
RECOMMENDATION,
FALSE_POSITIVE,
FALSE_RECOMMENDATION,
DICTIONARY_REMOVAL
DICTIONARY_REMOVAL,
TEMPORARY
}

View File

@ -74,7 +74,7 @@ public class TextEntity implements IEntity {
SemanticNode deepestFullyContainingNode;
@Builder.Default
Map<TextEntity, Relation> relations = new HashMap<>();
Map<TextEntity, Set<Relation>> relations = new HashMap<>();
@Builder.Default
Collection<EntityEventListener> entityEventListeners = new ArrayList<>();
@ -174,7 +174,7 @@ public class TextEntity implements IEntity {
pages.forEach(page -> page.getEntities().remove(this));
intersectingNodes = new LinkedList<>();
relations.keySet()
.forEach(entity -> entity.relations.remove(this));
.forEach(entity -> entity.getRelations().remove(this));
relations = new HashedMap<>();
deepestFullyContainingNode = null;
pages = new HashSet<>();

View File

@ -181,7 +181,7 @@ public class EntityFindingUtility {
return textBlocks.stream()
.flatMap(searchImplementation::getBoundaries)
.map(boundary -> entityCreationService.byTextRangeWithEngine(boundary, "temp", EntityType.ENTITY, node, Collections.emptySet()))
.map(boundary -> entityCreationService.byTextRangeWithEngine(boundary, "temp", EntityType.TEMPORARY, node, Collections.emptySet()))
.filter(Optional::isPresent)
.map(Optional::get)
.distinct()
@ -208,7 +208,7 @@ public class EntityFindingUtility {
return textBlocks.stream()
.flatMap(tb -> searchImplementation.getBoundaries(tb)
.filter(textRange -> entityCreationService.isValidEntityTextRange(tb, textRange)))
.map(boundary -> entityCreationService.byTextRangeWithEngine(boundary, "temp", EntityType.ENTITY, document, Collections.emptySet()))
.map(boundary -> entityCreationService.byTextRangeWithEngine(boundary, "temp", EntityType.TEMPORARY, document, Collections.emptySet()))
.filter(Optional::isPresent)
.map(Optional::get)
.distinct()
@ -222,7 +222,7 @@ public class EntityFindingUtility {
return searchImplementation.getBoundaries(document.getTextBlock())
.filter(textRange -> entityCreationService.isValidEntityTextRange(document.getTextBlock(), textRange))
.map(boundary -> entityCreationService.byTextRangeWithEngine(boundary, "temp", EntityType.ENTITY, document, Collections.emptySet()))
.map(boundary -> entityCreationService.byTextRangeWithEngine(boundary, "temp", EntityType.TEMPORARY, document, Collections.emptySet()))
.filter(Optional::isPresent)
.map(Optional::get)
.distinct()

View File

@ -431,7 +431,7 @@ public class EntityLogCreatorService {
private static EntryType getEntryType(EntityType entityType) {
return switch (entityType) {
case ENTITY -> EntryType.ENTITY;
case ENTITY, TEMPORARY -> EntryType.ENTITY;
case HINT -> EntryType.HINT;
case FALSE_POSITIVE, DICTIONARY_REMOVAL -> EntryType.FALSE_POSITIVE;
case RECOMMENDATION -> EntryType.RECOMMENDATION;

View File

@ -90,7 +90,7 @@ public class ManualChangesApplicationService {
.map(ManualChangesApplicationService::toRectangle2D)
.collect(Collectors.toList()));
entityToBeResized.addManualChange(manualResizeRedaction);
entityToBeResized.getManualOverwrite().addChange(manualResizeRedaction);
SemanticNode node = entityToBeResized.getDeepestFullyContainingNode();
PrecursorEntity searchEntity = PrecursorEntity.fromManualResizeRedaction(manualResizeRedaction);
@ -106,7 +106,7 @@ public class ManualChangesApplicationService {
.stream()
.flatMap(Collection::stream)
.forEach(TextEntity::removeFromGraph);
return;
break;
}
possibleEntities.values()
@ -117,9 +117,10 @@ public class ManualChangesApplicationService {
if (node.hasParent()) {
node = node.getParent();
} else {
break;
node = null;
}
}
entityToBeResized.notifyEntityUpdated();
}

View File

@ -1,5 +1,9 @@
package com.iqser.red.service.redaction.v1.server.service.drools;
import java.util.Collection;
import java.util.Collections;
import java.util.function.Consumer;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;
@ -26,17 +30,11 @@ public class KieSessionUpdater implements EntityEventListener {
onEntityInserted(entity);
}
@Override
public void onEntityInserted(IEntity entity) {
if (entity instanceof TextEntity textEntity) {
updateIntersectingNodes(textEntity);
textEntity.getRelations().values()
.forEach(kieSession::insert);
textEntity.getRelations().keySet()
.forEach(k -> kieSession.insert(k.getRelations()
.get(textEntity)));
}
handleOnEntityEvent(entity, kieSession::insert);
kieSession.insert(entity);
}
@ -44,21 +42,7 @@ public class KieSessionUpdater implements EntityEventListener {
@Override
public void onEntityUpdated(IEntity entity) {
if (entity instanceof TextEntity textEntity) {
updateIntersectingNodes(textEntity);
textEntity.getRelations().values()
.forEach(this::updateFactIfPresent);
textEntity.getRelations().keySet()
.forEach(k -> updateFactIfPresent(k.getRelations()
.get(textEntity)));
}
if (entity instanceof Image image) {
SemanticNode parent = image;
while (parent.hasParent()) {
parent = parent.getParent();
kieSession.update(kieSession.getFactHandle(parent), parent);
}
}
handleOnEntityEvent(entity, this::updateFactIfPresent);
kieSession.update(kieSession.getFactHandle(entity), entity);
}
@ -66,14 +50,24 @@ public class KieSessionUpdater implements EntityEventListener {
@Override
public void onEntityRemoved(IEntity entity) {
handleOnEntityEvent(entity, this::deleteFactIfPresent);
kieSession.delete(kieSession.getFactHandle(entity));
}
private void handleOnEntityEvent(IEntity entity, Consumer<Object> consumer) {
if (entity instanceof TextEntity textEntity) {
updateIntersectingNodes(textEntity);
textEntity.getRelations().values()
.forEach(this::deleteFactIfPresent);
.stream()
.flatMap(Collection::stream)
.forEach(consumer);
textEntity.getRelations().keySet()
.forEach(k -> deleteFactIfPresent(k.getRelations()
.get(textEntity)));
.forEach(k -> k.getRelations().getOrDefault(textEntity, Collections.emptySet())
.forEach(consumer));
}
if (entity instanceof Image image) {
SemanticNode parent = image;
while (parent.hasParent()) {
@ -81,7 +75,6 @@ public class KieSessionUpdater implements EntityEventListener {
kieSession.update(kieSession.getFactHandle(parent), parent);
}
}
kieSession.delete(kieSession.getFactHandle(entity));
}

View File

@ -1437,7 +1437,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -1462,7 +1462,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -1482,7 +1482,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1498,7 +1498,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1567,7 +1567,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(

View File

@ -1666,7 +1666,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
.build()))
.resizeRedactions(Set.of(ManualResizeRedaction.builder()
.updateDictionary(false)
.annotationId(davidKsenia.getId())
.annotationId("newId")
.fileId(TEST_FILE_ID)
.user("user")
.requestDate(OffsetDateTime.now())
@ -1691,7 +1691,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
assertEquals(EntryState.APPLIED, resizedEntity.getState());
assertEquals("David", resizedEntity.getValue());
assertEquals(1, resizedEntity.getManualChanges().size());
assertEquals(2, resizedEntity.getManualChanges().size());
assertEquals(1, resizedEntity.getEngines().size());
assertEquals(EntryState.REMOVED, removedEntity.getState());

View File

@ -158,7 +158,7 @@ public class PrecursorEntityTest extends BuildDocumentIntegrationTest {
Document document = buildGraph("files/syngenta/CustomerFiles/VV-919901.pdf");
EntityCreationService entityCreationService = new EntityCreationService();
List<TextEntity> tempEntities = entityCreationService.byString("To: Syngenta Ltd.", "temp", EntityType.ENTITY, document)
List<TextEntity> tempEntities = entityCreationService.byString("To: Syngenta Ltd.", "temp", EntityType.TEMPORARY, document)
.toList();
assertFalse(tempEntities.isEmpty());
var tempEntity = tempEntities.get(0);

View File

@ -8625,4 +8625,5 @@ Mustermann
Lastname
Bojangles
Tambourine Man
Tournayre J.C.
Tournayre J.C.
Phillip

View File

@ -11,7 +11,6 @@ Sude Halide Nurullah
Xinyi Y. Tao
Dorn
Prasher
David
annotation
J.B. RASCLE
(果梗を除去したもの)

View File

@ -1237,7 +1237,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -1262,7 +1262,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -1282,7 +1282,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1298,7 +1298,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1367,7 +1367,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -1401,7 +1401,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -2001,7 +2001,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -2026,7 +2026,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -2046,7 +2046,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -2062,7 +2062,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -2131,7 +2131,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -2165,7 +2165,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -1373,7 +1373,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -1398,7 +1398,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -1418,7 +1418,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1434,7 +1434,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1503,7 +1503,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(

View File

@ -964,7 +964,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -989,7 +989,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -1009,7 +1009,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1025,7 +1025,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1094,7 +1094,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -1128,7 +1128,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -285,7 +285,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -310,7 +310,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -330,7 +330,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -346,7 +346,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -415,7 +415,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -449,7 +449,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -1258,8 +1258,9 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -1284,7 +1285,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -1302,8 +1303,9 @@ rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
$contained.remove("X.0.1", "remove Entity contained by Entity of same type with manual changes");
end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1319,7 +1321,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1335,6 +1337,7 @@ rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
$contained.remove("X.2.1", "remove Entity of type HINT when contained by FALSE_POSITIVE");
end
// Rule unit: X.3
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
salience 64
@ -1352,6 +1355,7 @@ rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
$contained.remove("X.3.0", "remove Entity of type RECOMMENDATION when contained by FALSE_RECOMMENDATION");
end
// Rule unit: X.4
rule "X.4.0: Remove Entity of type RECOMMENDATION when text range equals ENTITY with same type"
salience 256
@ -1370,6 +1374,7 @@ rule "X.4.0: Remove Entity of type RECOMMENDATION when text range equals ENTITY
$b.remove("X.4.0", "remove Entity of type RECOMMENDATION when text range equals ENTITY with same type");
end
// Rule unit: X.5
rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
salience 256
@ -1386,7 +1391,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -1402,6 +1407,7 @@ rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority R
$contained.remove("X.5.1", "remove Entity of type RECOMMENDATION when contained by RECOMMENDATION");
end
// Rule unit: X.6
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
salience 32
@ -1419,7 +1425,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(
@ -1435,6 +1441,7 @@ rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
$contained.remove("X.6.1", "remove Entity when contained in another entity of type ENTITY or HINT with larger text range");
end
// Rule unit: X.8
rule "X.8.0: Remove Entity when text range and type equals to imported Entity"
salience 257
@ -1468,6 +1475,7 @@ rule "X.8.1: Remove Entity when intersected by imported Entity"
$b.remove("X.8.1", "remove Entity when intersected by imported Entity");
end
// Rule unit: X.9
rule "X.9.0: Merge mostly contained signatures"
when
@ -1488,6 +1496,7 @@ rule "X.10.0: remove false positives of ai"
$aiSignature.remove("X.10.0", "Removed because false positive");
end
// Rule unit: X.11
rule "X.11.1: Remove non-manual entity which intersects with a manual entity"
salience 64
@ -1522,7 +1531,6 @@ rule "X.11.2: Remove non-manual entity which is equal to manual entity"
end
//------------------------------------ Dictionary merging rules ------------------------------------
// Rule unit: DICT.0

View File

@ -345,7 +345,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -370,7 +370,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -390,7 +390,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -406,7 +406,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -475,7 +475,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -509,7 +509,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -435,7 +435,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -460,7 +460,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -480,7 +480,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -496,7 +496,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -565,7 +565,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -599,7 +599,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -335,7 +335,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -360,7 +360,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -380,7 +380,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -396,7 +396,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -412,7 +412,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -428,7 +428,7 @@ rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
$contained.remove("X.2.1", "remove Entity of type HINT when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -497,7 +497,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -531,7 +531,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -848,7 +848,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -873,7 +873,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -893,7 +893,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -909,7 +909,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -978,7 +978,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -1012,7 +1012,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -2020,7 +2020,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -2046,7 +2046,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -2084,7 +2084,7 @@ rule "X.0.4: Remove Entity contained by Entity of same type"
end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -2101,7 +2101,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -2170,7 +2170,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
$b.remove("X.5.0", "remove Entity of type RECOMMENDATION when intersected by ENTITY");
end
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(
@ -2204,7 +2204,7 @@ rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
$contained.remove("X.6.0", "remove Entity of lower rank when contained by entity of type ENTITY or HINT");
end
rule "X.6.1: Remove Smaller Text Range Contained by ENTITY or HINT"
rule "X.6.1: Remove Entity, when contained in another entity of type ENTITY or HINT with larger text range"
salience 32
when
$containment: Containment(

View File

@ -1439,7 +1439,7 @@ rule "MAN.4.1: Apply legal basis change"
//------------------------------------ Entity merging rules ------------------------------------
// Rule unit: X.0
rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
rule "X.0.0: Remove Entity contained by Entity of same type"
salience 65
when
$containment: Containment(
@ -1464,7 +1464,7 @@ rule "X.0.0: Remove Container Entity Contained by Container of Same Type"
$contained.remove("X.0.0", "remove Entity contained by Entity of same type");
end
rule "X.0.1: Remove Container and Contained Entities with Manual Changes"
rule "X.0.1: Remove Entity contained by Entity of same type with manual changes"
salience 65
when
$containment: Containment(
@ -1484,7 +1484,7 @@ end
// Rule unit: X.2
rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1501,7 +1501,7 @@ rule "X.2.0: Remove ENTITY and FALSE_POSITIVE Containing It"
end
rule "X.2.1: Remove HINT Contained by FALSE_POSITIVE"
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
salience 64
when
$containment: Containment(
@ -1572,7 +1572,7 @@ rule "X.5.0: Remove Entity of type RECOMMENDATION when intersected by ENTITY"
// Rule unit: X.5
rule "X.5.1: Remove Lower Priority RECOMMENDATION Contained by Higher Priority RECOMMENDATION"
rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATION"
salience 256
when
$containment: Containment(