RED-8834: Fixed text entities with empty text range #345
@ -594,6 +594,9 @@ public class EntityCreationService {
|
|||||||
throw new IllegalArgumentException(String.format("%s is not in the %s of the provided semantic node %s", textRange, node.getTextRange(), node));
|
throw new IllegalArgumentException(String.format("%s is not in the %s of the provided semantic node %s", textRange, node.getTextRange(), node));
|
||||||
}
|
}
|
||||||
TextRange trimmedTextRange = textRange.trim(node.getTextBlock());
|
TextRange trimmedTextRange = textRange.trim(node.getTextBlock());
|
||||||
|
if (trimmedTextRange.length() == 0){
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
TextEntity entity = TextEntity.initialEntityNode(trimmedTextRange, type, entityType, node);
|
TextEntity entity = TextEntity.initialEntityNode(trimmedTextRange, type, entityType, node);
|
||||||
if (node.getEntities().contains(entity)) {
|
if (node.getEntities().contains(entity)) {
|
||||||
Optional<TextEntity> optionalTextEntity = node.getEntities()
|
Optional<TextEntity> optionalTextEntity = node.getEntities()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user