Fixed RegEx for et al. recommendations

This commit is contained in:
Dominique Eifländer 2021-01-07 13:07:21 +01:00
parent e58b4ff6c1
commit 633fb403e0
2 changed files with 2 additions and 2 deletions

View File

@ -144,7 +144,7 @@ public class Section {
public void redactByRegEx(String pattern, boolean patternCaseInsensitive, int group, String asType, int ruleNumber, String reason, String legalBasis) {
Pattern compiledPattern = Patterns.getCompiledPattern(pattern, patternCaseInsensitive);
Matcher matcher = compiledPattern.matcher(text);
Matcher matcher = compiledPattern.matcher(searchText);
while (matcher.find()) {
String match = matcher.group(group);

View File

@ -138,7 +138,7 @@ rule "12: Add recommendation for et al. author"
when
Section(searchText.contains("et al."))
then
section.addRecommendationByRegEx("([^\\s(]*?( \\w\\.?)?) et al\\.?", false, 1, "CBI_author");
section.addRecommendationByRegEx("\\b([A-ZÄÖÜ][^\\s\\.,]+( [A-ZÄÖÜ]\\.?)?( [A-ZÄÖÜ]\\.?)?) et al\\.?", false, 1, "CBI_author");
end
// --------------------------------------- PII rules -------------------------------------------------------------------