RED-8670: fix bug in LineBuilderService, change constant in line classification
This commit is contained in:
parent
065abc5ae2
commit
77fed8353f
@ -32,6 +32,9 @@ public class LineBuilderService {
|
|||||||
characters.forEach(character -> {
|
characters.forEach(character -> {
|
||||||
character.getNeighbors()
|
character.getNeighbors()
|
||||||
.forEach(neighbor -> {
|
.forEach(neighbor -> {
|
||||||
|
if (!characters.contains(neighbor.getCharacter())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
double normalizedHorizontalDistance = neighbor.getHorizontalDistance() / maxHorizontalDistance;
|
double normalizedHorizontalDistance = neighbor.getHorizontalDistance() / maxHorizontalDistance;
|
||||||
double normalizedVerticalDistance = neighbor.getVerticalDistance() / maxVerticalDistance;
|
double normalizedVerticalDistance = neighbor.getVerticalDistance() / maxVerticalDistance;
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import lombok.experimental.UtilityClass;
|
|||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class TextRulingsClassifier {
|
public class TextRulingsClassifier {
|
||||||
|
|
||||||
private final static double STRIKETHROUGH_ZONE = 0.5; // multiplied with text height, determines height of intersection interval for strikethrough lines.
|
private final static double STRIKETHROUGH_ZONE = 0.65; // multiplied with text height, determines height of intersection interval for strikethrough lines.
|
||||||
private final static double UNDERLINE_ZONE = 0.2; // multiplied with text height, determines height of intersection interval of underline lines.
|
private final static double UNDERLINE_ZONE = 0.2; // multiplied with text height, determines height of intersection interval of underline lines.
|
||||||
private final static double TEXT_BBOX_THRESHOLD_FACTOR = 0.15; // multiplied with text width then subtracted from word width. If ruling covers this width, it is considered as strikethrough/underline.
|
private final static double TEXT_BBOX_THRESHOLD_FACTOR = 0.15; // multiplied with text width then subtracted from word width. If ruling covers this width, it is considered as strikethrough/underline.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user