Pull request #225: RED-2167 rs1
Merge in RED/redaction-service from RED-2167-rs1 to master * commit 'ff97cba0c8935a44edf912310a459df879522c71': RED-2167: added computation of cellstarts for tables with two colums Adding persistence tests for file-management-service-processor Testcommit
This commit is contained in:
commit
86b28b0612
@ -142,7 +142,11 @@ public class SectionTextBuilderService {
|
|||||||
|
|
||||||
SearchableText entireTableText = new SearchableText();
|
SearchableText entireTableText = new SearchableText();
|
||||||
SectionText sectionText = new SectionText();
|
SectionText sectionText = new SectionText();
|
||||||
|
int start = 0;
|
||||||
|
List<Integer> cellStarts = new ArrayList<>();
|
||||||
for (List<Cell> row : table.getRows()) {
|
for (List<Cell> row : table.getRows()) {
|
||||||
|
|
||||||
|
|
||||||
for (Cell cell : row) {
|
for (Cell cell : row) {
|
||||||
if (CollectionUtils.isEmpty(cell.getTextBlocks())) {
|
if (CollectionUtils.isEmpty(cell.getTextBlocks())) {
|
||||||
continue;
|
continue;
|
||||||
@ -160,8 +164,14 @@ public class SectionTextBuilderService {
|
|||||||
for (TextBlock textBlock : cell.getTextBlocks()) {
|
for (TextBlock textBlock : cell.getTextBlocks()) {
|
||||||
entireTableText.addAll(textBlock.getSequences());
|
entireTableText.addAll(textBlock.getSequences());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
cellStarts.add(start);
|
||||||
|
start = start + cell.toString().trim().length() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
sectionText.setCellStarts(cellStarts);
|
||||||
|
|
||||||
sectionText.setText(entireTableText.toString());
|
sectionText.setText(entireTableText.toString());
|
||||||
sectionText.setHeadline(table.getHeadline());
|
sectionText.setHeadline(table.getHeadline());
|
||||||
|
|||||||
@ -176,6 +176,7 @@ public class RedactionIntegrationTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void stubClients() {
|
public void stubClients() {
|
||||||
|
//Testkommentar
|
||||||
|
|
||||||
when(rulesClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(0L);
|
when(rulesClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(0L);
|
||||||
when(rulesClient.getRules(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(new RulesResponse(RULES));
|
when(rulesClient.getRules(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(new RulesResponse(RULES));
|
||||||
@ -663,7 +664,7 @@ public class RedactionIntegrationTest {
|
|||||||
public void redactionTest() throws IOException {
|
public void redactionTest() throws IOException {
|
||||||
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
ClassPathResource pdfFileResource = new ClassPathResource("files/new/Single Study - Oral (Gavage) Mouse.pdf");
|
ClassPathResource pdfFileResource = new ClassPathResource("files/S11.pdf");
|
||||||
AnalyzeRequest request = prepareStorage(pdfFileResource.getInputStream());
|
AnalyzeRequest request = prepareStorage(pdfFileResource.getInputStream());
|
||||||
request.setExcludedPages(Set.of(1));
|
request.setExcludedPages(Set.of(1));
|
||||||
|
|
||||||
@ -888,7 +889,7 @@ public class RedactionIntegrationTest {
|
|||||||
public void classificationTest() throws IOException {
|
public void classificationTest() throws IOException {
|
||||||
|
|
||||||
System.out.println("classificationTest");
|
System.out.println("classificationTest");
|
||||||
ClassPathResource pdfFileResource = new ClassPathResource("files/new/Single Study - Oral (Gavage) Mouse.pdf");
|
ClassPathResource pdfFileResource = new ClassPathResource("files/S11.pdf");
|
||||||
|
|
||||||
AnalyzeRequest request = prepareStorage(pdfFileResource.getInputStream());
|
AnalyzeRequest request = prepareStorage(pdfFileResource.getInputStream());
|
||||||
|
|
||||||
@ -910,7 +911,7 @@ public class RedactionIntegrationTest {
|
|||||||
public void sectionsTest() throws IOException {
|
public void sectionsTest() throws IOException {
|
||||||
|
|
||||||
System.out.println("sectionsTest");
|
System.out.println("sectionsTest");
|
||||||
ClassPathResource pdfFileResource = new ClassPathResource("files/Fludioxonil/51 " + "Fludioxonil_RAR_02_Volume_2_2018-02-21.pdf");
|
ClassPathResource pdfFileResource = new ClassPathResource("files/S11.pdf");
|
||||||
|
|
||||||
AnalyzeRequest request = prepareStorage(pdfFileResource.getInputStream());
|
AnalyzeRequest request = prepareStorage(pdfFileResource.getInputStream());
|
||||||
|
|
||||||
@ -932,7 +933,7 @@ public class RedactionIntegrationTest {
|
|||||||
public void htmlTablesTest() throws IOException {
|
public void htmlTablesTest() throws IOException {
|
||||||
|
|
||||||
System.out.println("htmlTablesTest");
|
System.out.println("htmlTablesTest");
|
||||||
ClassPathResource pdfFileResource = new ClassPathResource("files/Metolachlor/S-Metolachlor_RAR_02_Volume_2_2018-09-06.pdf");
|
ClassPathResource pdfFileResource = new ClassPathResource("files/S11.pdf");
|
||||||
|
|
||||||
AnalyzeRequest request = prepareStorage(pdfFileResource.getInputStream());
|
AnalyzeRequest request = prepareStorage(pdfFileResource.getInputStream());
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user