Merge branch 'RED-10644-master' into 'master'

RED-10644: Fixed dublicated entries with whitespace at the end

Closes RED-10644

See merge request redactmanager/redaction-service!573
This commit is contained in:
Dominique Eifländer 2024-12-10 12:41:36 +01:00
commit 22b2a6474b
3 changed files with 4 additions and 4 deletions

View File

@ -985,11 +985,11 @@ public class EntityCreationService {
return Optional.empty(); // Entity has been recategorized and should not be created at all.
}
TextEntity existingEntity = optionalTextEntity.get();
if (existingEntity.getTextRange().equals(textRange)) {
if (existingEntity.getTextRange().equals(trimmedTextRange)) {
return optionalTextEntity; // exactly the same entity, return directly
}
if (!existingEntity.resized()) {
addDuplicateEntityToGraph(existingEntity, textRange, node);
addDuplicateEntityToGraph(existingEntity, trimmedTextRange, node);
return optionalTextEntity; // If Entity has not been resized, insert as duplicate at appropriate position
}
return Optional.empty(); // Entity has been resized, if there are duplicates they should be treated there

View File

@ -243,7 +243,7 @@ public abstract class AbstractRedactionIntegrationTest {
public static void init() {
synchronized (PDFNet.class) {
PDFNet.initialize("demo:1650351709282:7bd235e003000000004ec28a6743e1163a085e2115de2536ab6e2cfe5a");
PDFNet.initialize("demo:admin@knecon.com:7ed45ca80200000000c1e1765b94afccf5bbc0cb8582fd932c602e286a");
}
}

View File

@ -169,7 +169,7 @@ import lombok.extern.slf4j.Slf4j;
public static void init() {
synchronized (PDFNet.class) {
PDFNet.initialize("demo:1650351709282:7bd235e003000000004ec28a6743e1163a085e2115de2536ab6e2cfe5a");
PDFNet.initialize("demo:admin@knecon.com:7ed45ca80200000000c1e1765b94afccf5bbc0cb8582fd932c602e286a");
}
}