RED-1046: Ignore dictionary rank for words that are explicitly set in the rules

This commit is contained in:
Dominique Eifländer 2021-02-05 14:54:59 +01:00
parent ba8c4dc240
commit 8965e76548
2 changed files with 7 additions and 1 deletions

View File

@ -156,7 +156,7 @@ public class Section {
public void addHintAnnotation(String value, String asType) {
Set<Entity> found = findEntities(value.trim(), asType, true, false, 0, null, null);
EntitySearchUtils.addEntitiesWithHigherRank(entities, found, dictionary);
EntitySearchUtils.addEntitiesIgnoreRank(entities, found);
}

View File

@ -121,4 +121,10 @@ public class EntitySearchUtils {
}
entities.add(found);
}
public void addEntitiesIgnoreRank(Set<Entity> entities, Set<Entity> found){
// HashSet keeps old value but we want the new.
entities.removeAll(found);
entities.addAll(found);
}
}