RED-5381: Further imporve
This commit is contained in:
parent
2f72dc895c
commit
248e4100c0
@ -69,7 +69,7 @@ public class TextBlock extends AbstractTextContainer {
|
||||
public float getX1() {
|
||||
|
||||
if (getDir().getDegrees() == 90) {
|
||||
return minX;
|
||||
return minY;
|
||||
}
|
||||
else if (getDir().getDegrees() == 180) {
|
||||
return getPageWidth() - maxX;
|
||||
@ -90,7 +90,7 @@ public class TextBlock extends AbstractTextContainer {
|
||||
public float getX2() {
|
||||
|
||||
if (getDir().getDegrees() == 90) {
|
||||
return maxX;
|
||||
return maxY;
|
||||
}
|
||||
|
||||
else if (getDir().getDegrees() == 180) {
|
||||
@ -116,7 +116,7 @@ public class TextBlock extends AbstractTextContainer {
|
||||
public float getY1() {
|
||||
|
||||
if (getDir().getDegrees() == 90 ) {
|
||||
return minY;
|
||||
return minX;
|
||||
}
|
||||
|
||||
else if (getDir().getDegrees() == 180) {
|
||||
@ -139,7 +139,7 @@ public class TextBlock extends AbstractTextContainer {
|
||||
public float getY2() {
|
||||
|
||||
if (getDir().getDegrees() == 90) {
|
||||
return maxY;
|
||||
return maxX;
|
||||
}
|
||||
|
||||
else if (getDir().getDegrees() == 180 ) {
|
||||
|
||||
@ -68,7 +68,7 @@ public class ClassificationService {
|
||||
public void classifyBlock(TextBlock textBlock, Rectangle bodyTextFrame, Page page, Document document,
|
||||
List<Float> headlineFontSizes) {
|
||||
|
||||
System.out.println("B" + textBlock.getSequences().get(0).getDir());
|
||||
System.out.println("Page: " + page.getPageNumber() + " rotation " + page.getRotation() +" B " + textBlock.getSequences().get(0).getDir());
|
||||
|
||||
if (document.getFontSizeCounter().getMostPopular() == null) {
|
||||
textBlock.setClassification("Other");
|
||||
|
||||
@ -160,12 +160,9 @@ public class TextPositionSequence implements CharSequence {
|
||||
@JsonAttribute(ignore = true)
|
||||
public float getX1() {
|
||||
|
||||
if (getDir().getDegrees() == 90) {
|
||||
return textPositions.get(0).getYDirAdj() - getTextHeight();
|
||||
}
|
||||
else {
|
||||
|
||||
return textPositions.get(0).getXDirAdj();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -173,14 +170,9 @@ public class TextPositionSequence implements CharSequence {
|
||||
@JsonAttribute(ignore = true)
|
||||
public float getX2() {
|
||||
|
||||
if (getDir().getDegrees() == 90) {
|
||||
return textPositions.get(0).getYDirAdj();
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
return textPositions.get(textPositions.size() - 1).getXDirAdj() + textPositions.get(textPositions.size() - 1).getWidthDirAdj() + HEIGHT_PADDING;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -191,11 +183,9 @@ public class TextPositionSequence implements CharSequence {
|
||||
@JsonAttribute(ignore = true)
|
||||
public float getY1() {
|
||||
|
||||
if (getDir().getDegrees() == 90 ) {
|
||||
return textPositions.get(0).getXDirAdj();
|
||||
}
|
||||
|
||||
if (getDir().getDegrees() == 270) {
|
||||
|
||||
if (getDir().getDegrees() == 270 || getDir().getDegrees() == 90) {
|
||||
return textPositions.get(0).getYDirAdj() - getTextHeight();
|
||||
|
||||
}
|
||||
@ -210,11 +200,9 @@ public class TextPositionSequence implements CharSequence {
|
||||
@JsonAttribute(ignore = true)
|
||||
public float getY2() {
|
||||
|
||||
if (getDir().getDegrees() == 90) {
|
||||
return textPositions.get(textPositions.size() - 1).getXDirAdj() + getTextHeight() - HEIGHT_PADDING;
|
||||
}
|
||||
|
||||
if (getDir().getDegrees() == 270) {
|
||||
|
||||
if (getDir().getDegrees() == 270 || getDir().getDegrees() == 90) {
|
||||
return textPositions.get(0).getYDirAdj();
|
||||
}
|
||||
|
||||
|
||||
@ -1098,7 +1098,7 @@ public class RedactionIntegrationTest {
|
||||
|
||||
System.out.println("classificationTest");
|
||||
|
||||
AnalyzeRequest request = prepareStorage("files/RSS/02 - A22833B - Acute Oral (Up and Down) - Final Report1.pdf");
|
||||
AnalyzeRequest request = prepareStorage("files/new/VV-511309_OCR.pdf");
|
||||
|
||||
RedactionRequest redactionRequest = RedactionRequest.builder()
|
||||
.dossierId(request.getDossierId())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user