diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/RulingCleaningService.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/RulingCleaningService.java index d5a7626..53876c2 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/RulingCleaningService.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/RulingCleaningService.java @@ -34,7 +34,6 @@ public class RulingCleaningService { Rulings verticalAndHorizontalRulingLines; - // todo 8642: set cv parsed only when no rulings exist or just always add them? if (rulings.isEmpty() && parsedRulings != null) { verticalAndHorizontalRulingLines = extractVerticalAndHorizontalRulingLines(parsedRulings); } else { diff --git a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/graph/ViewerDocumentTest.java b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/graph/ViewerDocumentTest.java index 9511cdd..c1d31dc 100644 --- a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/graph/ViewerDocumentTest.java +++ b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/graph/ViewerDocumentTest.java @@ -41,23 +41,24 @@ public class ViewerDocumentTest extends BuildDocumentTest { @Test - @Disabled + //@Disabled @SneakyThrows public void testViewerDocumentWithTables() { - String fileName = "files/cv_tables/brokenTablesOnOcr_ocred.pdf"; - String tableFileName = "files/cv_tables/brokenTablesOnOcr_ocred.TABLES.json"; - String tmpFileName = "/tmp/" + Path.of(fileName).getFileName() + "_VIEWER.pdf"; + String fileName = "files/cv_tables/VV-331340-first100.pdf"; + String tableFileName = "files/cv_tables/VV-331340-first100.TABLES.json"; + Path path = Path.of(fileName); + String tmpFileName = "/tmp/" + path.getFileName() + "_VIEWER.pdf"; var mapper = ObjectMapperFactory.create(); var tableResponse = mapper.readValue(new ClassPathResource(tableFileName).getInputStream(), TableServiceResponse.class); var documentFile = new ClassPathResource(fileName).getFile(); - var classificationDocument = layoutParsingPipeline.parseLayout(LayoutParsingType.DOCUMINE, + var classificationDocument = layoutParsingPipeline.parseLayout(LayoutParsingType.REDACT_MANAGER, documentFile, new ImageServiceResponse(), tableResponse, - new VisualLayoutParsingResponse(),Path.of(fileName).getFileName().toFile().toString()); + new VisualLayoutParsingResponse(), path.getFileName().toFile().toString()); ViewerDocumentService viewerDocumentService = new ViewerDocumentService(null); LayoutGridService layoutGridService = new LayoutGridService(viewerDocumentService); Document document = DocumentGraphFactory.buildDocumentGraph(classificationDocument); @@ -65,5 +66,7 @@ public class ViewerDocumentTest extends BuildDocumentTest { layoutGridService.addLayoutGrid(documentFile, document, new File(tmpFileName), true); } + + }