Pull request #323: RED-3190: Ignore if surrounding text can not be calculate because of different parsing order from ui and backend
Merge in RED/redaction-service from RED-3190-master to master * commit '6a31ae642d34c61865b55b6b138ef4406c27ab63': RED-3190: Ignore if surrounding text can not be calculate because of different parsing order from ui and backend
This commit is contained in:
commit
3687a7e5a9
@ -22,7 +22,9 @@ import com.iqser.red.service.redaction.v1.server.redaction.utils.EntitySearchUti
|
|||||||
import com.iqser.red.service.redaction.v1.server.storage.RedactionStorageService;
|
import com.iqser.red.service.redaction.v1.server.storage.RedactionStorageService;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ManualRedactionSurroundingTextService {
|
public class ManualRedactionSurroundingTextService {
|
||||||
@ -88,6 +90,11 @@ public class ManualRedactionSurroundingTextService {
|
|||||||
|
|
||||||
Entity correctEntity = getEntityOnCorrectPosition(entitiesWithPositions, toFindPositions);
|
Entity correctEntity = getEntityOnCorrectPosition(entitiesWithPositions, toFindPositions);
|
||||||
|
|
||||||
|
if(correctEntity == null){
|
||||||
|
log.warn("Could not calculate surrounding text");
|
||||||
|
return Pair.of("","");
|
||||||
|
}
|
||||||
|
|
||||||
if (sectionText.getCellStarts() != null && !sectionText.getCellStarts().isEmpty()) {
|
if (sectionText.getCellStarts() != null && !sectionText.getCellStarts().isEmpty()) {
|
||||||
surroundingWordsService.addSurroundingText(Set.of(correctEntity), sectionText.getSearchableText(), null, sectionText
|
surroundingWordsService.addSurroundingText(Set.of(correctEntity), sectionText.getSearchableText(), null, sectionText
|
||||||
.getCellStarts());
|
.getCellStarts());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user