RED-9974: Ignore enoughChars when section identifierer regex matches for documine old

This commit is contained in:
Dominique Eifländer 2024-09-16 12:16:11 +02:00
parent a4d6d2326e
commit 6acc85266c

View File

@ -172,8 +172,7 @@ public class DocuMineClassificationService {
&& isAtLeast3Characters
&& !headlineWithSlashesMatches
&& !isAmount
&& !isTocItem
&& enoughChars) {
&& !isTocItem) {
setAsHeadline(headlineClassificationService, textBlock, document, headlineFontSizes);
} else if (!isTocItem
@ -182,8 +181,7 @@ public class DocuMineClassificationService {
&& PositionUtils.getApproxLineCount(textBlock) < 2.9
&& (tableOrFigureMatcher.reset().find() || headlineWithSingleIdentifierMatcher.reset().find())
&& !isAmount
&& !headlineWithSlashesMatches
&& enoughChars) {
&& !headlineWithSlashesMatches) {
setAsHeadline(headlineClassificationService, textBlock, document, headlineFontSizes);
} else if (PositionUtils.isWithinBodyTextFrame(bodyTextFrame, textBlock)
@ -248,7 +246,8 @@ public class DocuMineClassificationService {
return surroundingBlocks.stream()
.mapToDouble(surroundingBlock -> calculateSeparation(textBlock, surroundingBlock))
.min().orElse(Double.MAX_VALUE);
.min()
.orElse(Double.MAX_VALUE);
}