RED-8481: Use visual layout parsing to detect signatures
fixed failing tests because of null pointer
This commit is contained in:
parent
cfc5db45cd
commit
c3e7582ee3
@ -215,7 +215,10 @@ public class LayoutParsingPipeline {
|
||||
addNumberOfPagesToTrace(originDocument.getNumberOfPages(), Files.size(originFile.toPath()));
|
||||
Map<Integer, List<TableCells>> pdfTableCells = cvTableParsingAdapter.buildCvParsedTablesPerPage(tableServiceResponse);
|
||||
Map<Integer, List<ClassifiedImage>> pdfImages = imageServiceResponseAdapter.buildClassifiedImagesPerPage(imageServiceResponse);
|
||||
Map<Integer, List<ClassifiedImage>> signatures = visualLayoutParsingAdapter.buildExtractedSignaturesPerPage(visualLayoutParsingResponse);
|
||||
Map<Integer, List<ClassifiedImage>> signatures = null;
|
||||
if(visualLayoutParsingResponse != null) {
|
||||
signatures = visualLayoutParsingAdapter.buildExtractedSignaturesPerPage(visualLayoutParsingResponse);
|
||||
}
|
||||
|
||||
ClassificationDocument classificationDocument = new ClassificationDocument();
|
||||
List<ClassificationPage> classificationPages = new ArrayList<>();
|
||||
|
||||
@ -33,16 +33,13 @@ public class VisualLayoutParsingAdapter {
|
||||
}
|
||||
|
||||
public Map<Integer, List<ClassifiedImage>> buildExtractedSignaturesPerPage(VisualLayoutParsingResponse visualLayoutParsingResponse) {
|
||||
if(visualLayoutParsingResponse != null) {
|
||||
|
||||
Map<Integer, List<ClassifiedImage>> signatures = new HashMap<>();
|
||||
visualLayoutParsingResponse.getData()
|
||||
.forEach(tableData -> signatures.computeIfAbsent(tableData.getPage_idx(), tableCell -> new ArrayList<>())
|
||||
.addAll(convertSignatures(tableData.getPage_idx(), tableData.getBoxes())));
|
||||
Map<Integer, List<ClassifiedImage>> signatures = new HashMap<>();
|
||||
visualLayoutParsingResponse.getData()
|
||||
.forEach(tableData -> signatures.computeIfAbsent(tableData.getPage_idx(), tableCell -> new ArrayList<>())
|
||||
.addAll(convertSignatures(tableData.getPage_idx(), tableData.getBoxes())));
|
||||
|
||||
return signatures;
|
||||
}
|
||||
return null;
|
||||
return signatures;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user