RED-3327: Ignore recommendations if touches other type

This commit is contained in:
deiflaender 2022-02-01 09:41:21 +01:00
parent 0e9082fadc
commit 07ffd90058

View File

@ -128,7 +128,12 @@ public class EntitySearchUtils {
for (Entity inner : entities) {
if (inner.getWord().length() < word.getWord()
.length() && inner.getStart() >= word.getStart() && inner.getEnd() <= word.getEnd() && word != inner && word.getSectionNumber() == inner.getSectionNumber()) {
wordsToRemove.add(inner);
// 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);
}
}
}
}