Parser Improvement: Trailing commas from truncated page-break text not cleaned
Severity: MEDIUM
File: ocr_correct.py
Function: correct_ocr_errors
Estimated errors fixed: 1
Current Behavior
When text is truncated at a page break (e.g., 'keamanan , , ,'), trailing sequences of commas/spaces remain in the output. These are artifacts of partial text extraction where the rest of the line was on the next page.
Proposed Fix
Add a pattern to clean up trailing sequences of commas (with optional spaces) that indicate truncated text at page boundaries.
Code Before
# Common scanner artifacts
(re.compile(r'^[;,.]$', re.MULTILINE), ''), # Lone punctuation on a line
Code After
# Common scanner artifacts
(re.compile(r'^[;,.]$', re.MULTILINE), ''), # Lone punctuation on a line
# Trailing comma sequences from page-break truncation: 'word , , ,'
(re.compile(r'(?:\s*,\s*){2,}\s*$', re.MULTILINE), ''),
Generated by the Pasal.id Correction Agent (Opus 4.6) after analyzing 3 parser feedback entries.
Parser Improvement: Trailing commas from truncated page-break text not cleaned
Severity: MEDIUM
File:
ocr_correct.pyFunction:
correct_ocr_errorsEstimated errors fixed: 1
Current Behavior
When text is truncated at a page break (e.g., 'keamanan , , ,'), trailing sequences of commas/spaces remain in the output. These are artifacts of partial text extraction where the rest of the line was on the next page.
Proposed Fix
Add a pattern to clean up trailing sequences of commas (with optional spaces) that indicate truncated text at page boundaries.
Code Before
Code After
Generated by the Pasal.id Correction Agent (Opus 4.6) after analyzing 3 parser feedback entries.