RED-499: Changed prefix for redactions, fixed legalbasis problem

This commit is contained in:
deiflaender 2020-10-28 13:02:18 +01:00
parent 97257a9c08
commit 0015304eea
3 changed files with 5 additions and 4 deletions

View File

@ -31,7 +31,7 @@ public class Entity {
private int sectionNumber;
public Entity(String word, String type, boolean redaction, String redactionReason, List<EntityPositionSequence> positionSequences, String headline, int matchedRule, int sectionNumber) {
public Entity(String word, String type, boolean redaction, String redactionReason, List<EntityPositionSequence> positionSequences, String headline, int matchedRule, int sectionNumber, String legalBasis) {
this.word = word;
this.type = type;
@ -41,6 +41,7 @@ public class Entity {
this.headline = headline;
this.matchedRule = matchedRule;
this.sectionNumber = sectionNumber;
this.legalBasis = legalBasis;
}

View File

@ -117,7 +117,7 @@ public class EntityRedactionService {
classifiedDoc.getEntities()
.computeIfAbsent(entry.getKey(), (x) -> new ArrayList<>())
.add(new Entity(entity.getWord(), entity.getType(), entity.isRedaction(), entity.getRedactionReason(), entry
.getValue(), entity.getHeadline(), entity.getMatchedRule(), entity.getSectionNumber()));
.getValue(), entity.getHeadline(), entity.getMatchedRule(), entity.getSectionNumber(), entity.getLegalBasis()));
}
}

View File

@ -169,7 +169,7 @@ public class AnnotationHighlightService {
}
if (entity.isRedaction()) {
return "redaction:" + entity.getType() + ":" + id;
return "redaction:" + entity.getType() + ":automatic:" + id;
}
return "ignore:" + entity.getType() + ":" + id;
}
@ -235,7 +235,7 @@ public class AnnotationHighlightService {
private String prefixId(ManualRedactionEntry manualRedactionEntry, String id) {
if (manualRedactionEntry.getStatus().equals(Status.APPROVED)) {
return "redaction:" + manualRedactionEntry.getType() + ":" + id;
return "redaction:" + manualRedactionEntry.getType() + ":manual:" + id;
}
if (manualRedactionEntry.getStatus().equals(Status.REQUESTED)) {