RED-8670: fix bug in LineBuilderService, change constant in line classification

This commit is contained in:
Kilian Schuettler 2025-01-16 13:24:31 +01:00
parent 065abc5ae2
commit 77fed8353f
2 changed files with 4 additions and 1 deletions

View File

@ -32,6 +32,9 @@ public class LineBuilderService {
characters.forEach(character -> {
character.getNeighbors()
.forEach(neighbor -> {
if (!characters.contains(neighbor.getCharacter())) {
return;
}
double normalizedHorizontalDistance = neighbor.getHorizontalDistance() / maxHorizontalDistance;
double normalizedVerticalDistance = neighbor.getVerticalDistance() / maxVerticalDistance;

View File

@ -12,7 +12,7 @@ import lombok.experimental.UtilityClass;
@UtilityClass
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 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.