purity III
This commit is contained in:
parent
db5baee889
commit
b14f3aa710
@ -140,7 +140,7 @@ public class Section {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void dismissByRegEx(String type, String pattern, boolean patternCaseInsensitive, int group) {
|
public void expandToHintAnnotationByRegEx(String type, String pattern, boolean patternCaseInsensitive, int group, String asType) {
|
||||||
|
|
||||||
Pattern compiledPattern = Patterns.getCompiledPattern(pattern, patternCaseInsensitive);
|
Pattern compiledPattern = Patterns.getCompiledPattern(pattern, patternCaseInsensitive);
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ public class Section {
|
|||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
String match = matcher.group(group);
|
String match = matcher.group(group);
|
||||||
if (StringUtils.isNotBlank(match)) {
|
if (StringUtils.isNotBlank(match)) {
|
||||||
expanded.addAll(findEntities(entity.getWord() + match, type, false, entity.isRedaction(), 0, null, null));
|
expanded.addAll(findEntities(entity.getWord() + match, asType, false, false, 0, null, null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,6 +166,22 @@ public class Section {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void addHintAnnotationByRegEx(String pattern, boolean patternCaseInsensitive, int group, String asType) {
|
||||||
|
|
||||||
|
Pattern compiledPattern = Patterns.getCompiledPattern(pattern, patternCaseInsensitive);
|
||||||
|
|
||||||
|
Matcher matcher = compiledPattern.matcher(searchText);
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
String match = matcher.group(group);
|
||||||
|
if (StringUtils.isNotBlank(match)) {
|
||||||
|
Set<Entity> found = findEntities(match.trim(), asType, false, false, 0, null, null);
|
||||||
|
EntitySearchUtils.addEntitiesWithHigherRank(entities, found, dictionary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void redactIfPrecededBy(String prefix, String type, int ruleNumber, String reason, String legalBasis) {
|
public void redactIfPrecededBy(String prefix, String type, int ruleNumber, String reason, String legalBasis) {
|
||||||
|
|
||||||
entities.forEach(entity -> {
|
entities.forEach(entity -> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user