Pull request #339: RED-3327: Ignore recommendations if touches other type
Merge in RED/redaction-service from RED-3327-master to master * commit '8689125ed9b09f73781d3babfd65537c0b1f4afe': RED-3327: Ignore recommendations if touches other type
This commit is contained in:
commit
90fe282313
@ -128,10 +128,15 @@ public class EntitySearchUtils {
|
|||||||
for (Entity inner : entities) {
|
for (Entity inner : entities) {
|
||||||
if (inner.getWord().length() < word.getWord()
|
if (inner.getWord().length() < word.getWord()
|
||||||
.length() && inner.getStart() >= word.getStart() && inner.getEnd() <= word.getEnd() && word != inner && word.getSectionNumber() == inner.getSectionNumber()) {
|
.length() && inner.getStart() >= word.getStart() && inner.getEnd() <= word.getEnd() && word != inner && word.getSectionNumber() == inner.getSectionNumber()) {
|
||||||
|
// FIXME this is workaround for RED-3327 and should be removed in the future.
|
||||||
|
if(word.getType().contains("recommendation_") && !inner.getType().contains("recommendation_")) {
|
||||||
|
wordsToRemove.add(word);
|
||||||
|
} else {
|
||||||
wordsToRemove.add(inner);
|
wordsToRemove.add(inner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
entities.removeAll(wordsToRemove);
|
entities.removeAll(wordsToRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user