RED-7156: filter out dictionary add manual redaction entries
This commit is contained in:
parent
68fe33ab70
commit
9b081e8739
@ -57,7 +57,10 @@ public class CustomEntityCreationAdapter {
|
|||||||
|
|
||||||
public List<RedactionEntity> createRedactionEntities(Set<ManualRedactionEntry> manualRedactionEntries, SemanticNode node) {
|
public List<RedactionEntity> createRedactionEntities(Set<ManualRedactionEntry> manualRedactionEntries, SemanticNode node) {
|
||||||
|
|
||||||
List<EntityIdentifier> entityIdentifiers = manualRedactionEntries.stream().map(EntityIdentifier::fromManualRedactionEntry).toList();
|
List<EntityIdentifier> entityIdentifiers = manualRedactionEntries.stream()
|
||||||
|
.filter(manualRedactionEntry -> !manualRedactionEntry.isAddToDictionary() || !manualRedactionEntry.isAddToDossierDictionary())
|
||||||
|
.map(EntityIdentifier::fromManualRedactionEntry)
|
||||||
|
.toList();
|
||||||
return toRedactionEntity(entityIdentifiers, node);
|
return toRedactionEntity(entityIdentifiers, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,9 +144,10 @@ public class CustomEntityCreationAdapter {
|
|||||||
private Map<String, List<RedactionEntity>> findAllPossibleEntitiesAndGroupByValue(SemanticNode node, Set<Integer> pageNumbers, Set<String> entryValues) {
|
private Map<String, List<RedactionEntity>> findAllPossibleEntitiesAndGroupByValue(SemanticNode node, Set<Integer> pageNumbers, Set<String> entryValues) {
|
||||||
|
|
||||||
if (!pageNumbers.stream().allMatch(node::isOnPage)) {
|
if (!pageNumbers.stream().allMatch(node::isOnPage)) {
|
||||||
throw new IllegalArgumentException(format("SemanticNode %s does not contain these pages %s present in the redaction log",
|
throw new IllegalArgumentException(format("SemanticNode \"%s\" does not contain these pages %s, it has pages: %s",
|
||||||
node,
|
node,
|
||||||
pageNumbers.stream().filter(pageNumber -> !node.isOnPage(pageNumber)).toList()));
|
pageNumbers.stream().filter(pageNumber -> !node.isOnPage(pageNumber)).toList(),
|
||||||
|
node.getPages()));
|
||||||
}
|
}
|
||||||
SearchImplementation searchImplementation = new SearchImplementation(entryValues, true);
|
SearchImplementation searchImplementation = new SearchImplementation(entryValues, true);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user