Pull request #481: RED-5275: Fixed not all headline were found because headline contains newlines
Merge in RED/redaction-service from RED-5275 to master * commit '074205aa4d4532d5143463ab80199be08e1599a1': RED-5275: Fixed not all headline were found because headline contains newlines
This commit is contained in:
commit
97209a3508
@ -942,10 +942,16 @@ public class Section {
|
|||||||
@Argument(ArgumentType.STRING) String reason,
|
@Argument(ArgumentType.STRING) String reason,
|
||||||
@Argument(ArgumentType.LEGAL_BASIS) String legalBasis) {
|
@Argument(ArgumentType.LEGAL_BASIS) String legalBasis) {
|
||||||
|
|
||||||
if (!headline.isBlank() && searchText.contains(headline)) {
|
|
||||||
|
|
||||||
Set<Entity> found = findEntities(headline.trim(), type, false, true, ruleNumber, reason, legalBasis, Engine.RULE, false);
|
|
||||||
EntitySearchUtils.addEntitiesWithHigherRank(entities, found, dictionary);
|
|
||||||
|
if (!headline.isBlank()) {
|
||||||
|
|
||||||
|
String cleanHeadline = headline.replaceAll("\\n", " ").replaceAll(" ", " ").trim();
|
||||||
|
if(searchText.contains(cleanHeadline)) {
|
||||||
|
Set<Entity> found = findEntities(cleanHeadline, type, false, true, ruleNumber, reason, legalBasis, Engine.RULE, false);
|
||||||
|
EntitySearchUtils.addEntitiesWithHigherRank(entities, found, dictionary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user