Fixed recognize rules and exceptions for redactAndRecommend, fixed wrong order of rules(published information)
This commit is contained in:
parent
531eeebae1
commit
7dfaf604e7
@ -211,9 +211,8 @@ public class Section {
|
|||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
String match = matcher.group(group);
|
String match = matcher.group(group);
|
||||||
if (StringUtils.isNotBlank(match) && match.length() >= 3) {
|
if (StringUtils.isNotBlank(match) && match.length() >= 3) {
|
||||||
Set<Entity> found = findEntities(match.trim(), asType, false, false, ruleNumber, reason, legalBasis);
|
|
||||||
addNewerToEntities(found);
|
|
||||||
localDictionaryAdds.computeIfAbsent(RECOMMENDATION_PREFIX + asType, (x) -> new HashSet<>()).add(match);
|
localDictionaryAdds.computeIfAbsent(RECOMMENDATION_PREFIX + asType, (x) -> new HashSet<>()).add(match);
|
||||||
|
localDictionaryAdds.computeIfAbsent(asType, (x) -> new HashSet<>()).add(match);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,16 +39,7 @@ rule "4: Do not redact Names and Addresses if no redaction Indicator is containe
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
rule "5: Do not redact Names and Addresses if no redaction Indicator is contained"
|
rule "5: Redact Names and Addresses if no_redaction_indicator and redaction_indicator is contained"
|
||||||
when
|
|
||||||
Section(matchesType("vertebrate"), matchesType("published_information"))
|
|
||||||
then
|
|
||||||
section.redactNot("CBI_author", 4, "Vertebrate and Published Information found");
|
|
||||||
section.redactNot("CBI_address", 5, "Vertebrate and Published Information found");
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
rule "6: Redact Names and Addresses if no_redaction_indicator and redaction_indicator is contained"
|
|
||||||
when
|
when
|
||||||
Section(matchesType("vertebrate"), matchesType("no_redaction_indicator"), matchesType("redaction_indicator"))
|
Section(matchesType("vertebrate"), matchesType("no_redaction_indicator"), matchesType("redaction_indicator"))
|
||||||
then
|
then
|
||||||
@ -56,6 +47,15 @@ rule "6: Redact Names and Addresses if no_redaction_indicator and redaction_indi
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "6: Do not redact Names and Addresses if no redaction Indicator is contained"
|
||||||
|
when
|
||||||
|
Section(matchesType("vertebrate"), matchesType("published_information"))
|
||||||
|
then
|
||||||
|
section.redactNot("CBI_author", 6, "Vertebrate and Published Information found");
|
||||||
|
section.redactNot("CBI_address", 6, "Vertebrate and Published Information found");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
rule "7: Not redacted because Vertebrate Study = N"
|
rule "7: Not redacted because Vertebrate Study = N"
|
||||||
when
|
when
|
||||||
Section(rowEquals("Vertebrate study Y/N", "N") || rowEquals("Vertebrate study Y/N", "No"))
|
Section(rowEquals("Vertebrate study Y/N", "N") || rowEquals("Vertebrate study Y/N", "No"))
|
||||||
|
|||||||
@ -34,21 +34,21 @@ rule "3: Do not redact Names and Addresses if no redaction Indicator is containe
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
rule "4: Do not redact Names and Addresses if no redaction Indicator is contained"
|
rule "4: Redact Names and Addresses if no_redaction_indicator and redaction_indicator is contained"
|
||||||
when
|
|
||||||
Section(matchesType("vertebrate"), matchesType("published_information"))
|
|
||||||
then
|
|
||||||
section.redactNot("CBI_author", 4, "Vertebrate and Published Information found");
|
|
||||||
section.redactNot("CBI_address", 4, "Vertebrate and Published Information found");
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
rule "5: Redact Names and Addresses if no_redaction_indicator and redaction_indicator is contained"
|
|
||||||
when
|
when
|
||||||
Section(matchesType("vertebrate"), matchesType("no_redaction_indicator"), matchesType("redaction_indicator"))
|
Section(matchesType("vertebrate"), matchesType("no_redaction_indicator"), matchesType("redaction_indicator"))
|
||||||
then
|
then
|
||||||
section.redact("CBI_author", 5, "Vertebrate and Redaction Indicator found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
section.redact("CBI_author", 4, "Vertebrate and Redaction Indicator found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.redact("CBI_address", 5, "Vertebrate and Redaction Indicator found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
section.redact("CBI_address", 4, "Vertebrate and Redaction Indicator found", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "5: Do not redact Names and Addresses if no redaction Indicator is contained"
|
||||||
|
when
|
||||||
|
Section(matchesType("vertebrate"), matchesType("published_information"))
|
||||||
|
then
|
||||||
|
section.redactNot("CBI_author", 5, "Vertebrate and Published Information found");
|
||||||
|
section.redactNot("CBI_address", 5, "Vertebrate and Published Information found");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user