RED-1046: Ignore dictionary rank for words that are explicitly set in the rules
This commit is contained in:
parent
ba8c4dc240
commit
8965e76548
@ -156,7 +156,7 @@ public class Section {
|
|||||||
public void addHintAnnotation(String value, String asType) {
|
public void addHintAnnotation(String value, String asType) {
|
||||||
|
|
||||||
Set<Entity> found = findEntities(value.trim(), asType, true, false, 0, null, null);
|
Set<Entity> found = findEntities(value.trim(), asType, true, false, 0, null, null);
|
||||||
EntitySearchUtils.addEntitiesWithHigherRank(entities, found, dictionary);
|
EntitySearchUtils.addEntitiesIgnoreRank(entities, found);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -121,4 +121,10 @@ public class EntitySearchUtils {
|
|||||||
}
|
}
|
||||||
entities.add(found);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user