Pull request #119: RED-1046: Ignore dictionary rank for words that are explicitly set in the rules
Merge in RED/redaction-service from RED-1046 to master * commit '8965e7654867ff666c54c841319376c5899e7326': RED-1046: Ignore dictionary rank for words that are explicitly set in the rules
This commit is contained in:
commit
5ecf21290c
@ -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