Fix Indonesian currency parsing and pdfoxide preprocessing - #29
Conversation
Co-authored-by: rager306 <248269686+rager306@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
WalkthroughThe changes add text preprocessing functionality to handle PDF extraction artifacts by separating "smashed" adjacent amounts, extend the amount pattern regex to support both US and Indonesian number formats, and introduce comprehensive test coverage for the new preprocessing logic and currency format handling. Changes
Sequence Diagram(s)sequenceDiagram
participant Input as PDF Input
participant Parser as PDF Parser
participant Preprocess as Text Preprocessor
participant Extract as Transaction Extractor
participant Summary as Summary Generator
participant Output as Output
Input->>Parser: Raw PDF pages
Parser->>Parser: Iterate & accumulate text
Parser->>Preprocess: Full text with smashed amounts
Preprocess->>Preprocess: Insert line breaks<br/>(regex patterns)
Preprocess->>Extract: Cleaned text
Extract->>Extract: Parse transactions<br/>with amount pattern
Extract->>Summary: Transaction list
Summary->>Summary: Generate totals
Summary->>Output: Results
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Updated
_AMOUNT_PATTERNto support Indonesian currency format (comma decimal).Restored
preprocess_textinpdfparser/pdfoxide_parser.pyto handle smashed text columns.Added tests for Indonesian formats and preprocessing logic.
PR created automatically by Jules for task 9625070368568826983 started by @rager306
Summary by CodeRabbit
New Features
Tests