|
FOSSredder 0.5.0
|
Classes | |
| struct | ColumnGuess |
| Stores the inferred column positions for an OCR page. More... | |
| class | DefaultStatementParser |
| struct | FinalizeStats |
| struct | OcrLine |
| Represents one OCR line with its bounding box and recognized text. More... | |
| struct | PageWork |
| struct | ParserConfig |
| Runtime configuration for parser heuristics and thresholds. More... | |
| struct | RawLineLite |
| Lightweight raw-line representation used during grouping and splitting. More... | |
| struct | TransactionMainRow |
| Represents the parsed main row of a transaction block. More... | |
Typedefs | |
| using | ProgressReporter = std::function<void(double, const std::string&)> |
Functions | |
| bool | hasShortDateToken (const std::string &text) noexcept |
| Checks whether the text contains a short date token. | |
| bool | containsShortDate (const std::string &text) noexcept |
| Checks whether the text contains any short date pattern. | |
| std::optional< std::string > | findFirstFullDate (const std::string &text) noexcept |
| Finds the first full date in a text fragment. | |
| std::vector< size_t > | findAmountTokenIndices (const core::application::importing::transaction::internal::OcrLine &line, int valutaX=-1, int bandPx=0) noexcept |
| Finds the indices of amount-like tokens in an OCR line. | |
| std::string | normalizeAlnumLower (const std::string &s) noexcept |
| Normalizes alphanumeric text to lower-case ASCII for matching. | |
| std::optional< int > | findTokenCenterX (const core::application::importing::transaction::internal::OcrLine &line, const std::string &tokenLower) noexcept |
| Locates the horizontal center of a token inside an OCR line. | |
| std::optional< int > | findPhraseCenterX (const core::application::importing::transaction::internal::OcrLine &line, std::initializer_list< const char * > phraseLower) noexcept |
| Locates the horizontal center of a multi-token phrase in an OCR line. | |
| bool | hasTokenNearX (const core::application::importing::transaction::internal::OcrLine &line, int x, int bandPx) noexcept |
| Checks whether any token in the line is close to a horizontal position. | |
| bool | hasAmountLikeTokenInLine (const core::application::importing::transaction::internal::OcrLine &line, int valutaX) noexcept |
| Checks whether the line contains amount-like tokens near the valuta column. | |
| bool | hasLeftDescriptiveText (const core::application::importing::transaction::internal::OcrLine &line, int valutaX) noexcept |
| Checks whether the line contains descriptive text to the left of the valuta column. | |
| bool | hasAmountNearValuta (const core::application::importing::transaction::internal::OcrLine &line, int valutaX, int bandPx) noexcept |
| Checks whether an amount appears close to the valuta reference. | |
| bool | isLooseTransactionLine (const core::application::importing::transaction::internal::OcrLine &line, int valutaX) noexcept |
| Checks whether the line looks like a loosely formatted transaction row. | |
| std::optional< double > | findAndParseAmountInLine (const core::application::importing::transaction::internal::OcrLine &line, int valutaX=-1, std::vector< std::string > *debugOut=nullptr) noexcept |
| Finds and parses an amount token inside an OCR line. | |
| std::vector< core::application::importing::transaction::internal::OcrLine > | buildOcrLinesFromWords (const std::vector< core::ports::text_recognition::Word > &words) |
| Builds OCR lines from raw Tesseract word output. | |
| ColumnGuess | inferColumnModelFromLines (const std::vector< core::application::importing::transaction::internal::OcrLine > &lines, size_t scanN=16) noexcept |
| Infers a column layout from a set of OCR lines. | |
| std::vector< RawLineLite > | groupMergeLinesRaw (const std::vector< RawLineLite > &lines, int maxGapPx) |
| Merges raw lines using a gap-based heuristic. | |
| core::application::importing::transaction::internal::OcrLine | toOcrLineFromRawWords (const RawLineLite &src, size_t i0, size_t i1) noexcept |
| Converts a range of raw words into one OCR line. | |
| core::application::importing::transaction::internal::TransactionMainRow | splitMainRowFromRaw (const RawLineLite &src, int valutaX, int debitX, int creditX) noexcept |
| Splits a raw line into the main transaction row representation. | |
| core::application::importing::transaction::internal::TransactionMainRow | splitMainRowFromOcrLine (const core::application::importing::transaction::internal::OcrLine &src, int valutaX, int debitX, int creditX) noexcept |
| Splits an OCR line into the main transaction row representation. | |
| bool | isHeaderNoiseLine (const std::string &line) |
| Detects whether a line looks like header noise. | |
| bool | isFooterLine (const std::string &line) |
| Detects whether a line marks a footer section. | |
| bool | isPostTransactionFootnote (const std::string &line) |
| Detects whether a line belongs to the post-transaction footnote area. | |
| bool | isTransactionsSectionHeader (const std::string &line) |
| Detects whether a line marks the start of the transactions section. | |
| bool | isDebitCreditHeaderLine (const std::string &line) |
| Detects whether a line looks like a debit/credit table header. | |
| core::ports::text_recognition::Settings | buildRecognitionSettings (int defaultPsm) |
| core::ports::document_image_processing::MaskRequest | buildMaskRequest (const std::vector< uint8_t > &pageBytes, size_t pageIndex, const ImportRequest &req, const core::ports::pdf_rendering::ExtractResult &extractRes) |
| core::ports::text_recognition::ExtractRequest | buildMaskOcrRequest (const std::vector< uint8_t > &pageBytes, const ImportRequest &req) |
| core::ports::document_image_processing::DetectRequest | buildDetectRequest (const std::vector< uint8_t > &maskedBytes, size_t pageIndex, const ImportRequest &req) |
| core::ports::document_image_processing::CropRequest | buildCropRequest (const std::vector< uint8_t > &pageBytes, size_t pageIndex, const ImportRequest &req, const core::ports::document_image_processing::DetectResult &detectResponse) |
| core::ports::text_recognition::ExtractRequest | buildTableOcrRequest (const std::vector< uint8_t > &croppedBytes, size_t pageIndex, const ImportRequest &req, const core::ports::document_image_processing::DetectResult &detectResponse) |
| std::vector< uint8_t > | readImportBytes (const std::filesystem::path &path) |
| std::vector< uint8_t > | readImportBytes (const std::filesystem::path &path, core::ports::diagnostics::IErrorReporter *errorReporter) |
| PageWork | processImportPage (size_t pageIndex, size_t totalPages, const ImportRequest &req, const poppler::RenderResult &renderRes, const poppler::ExtractResult &extractRes, const std::shared_ptr< core::ports::document_image_processing::IDocumentImageProcessor > &documentImageProcessor, const std::shared_ptr< core::ports::text_recognition::ITextRecognizer > &tesseract, core::jobs::SlotLimiter *ocrLimiter, const ProgressReporter &report, std::atomic< size_t > &doneUnits, size_t totalUnits, core::ports::diagnostics::IErrorReporter *errorReporter, ImportResult &out, std::mutex &artifactsMutex) |
| FinalizeStats | finalizeParsedPages (const ImportRequest &req, const std::vector< PageWork > &pages, const std::shared_ptr< core::ports::document_image_processing::IDocumentImageProcessor > &documentImageProcessor, ImportResult &out, std::vector< core::application::importing::draft::TransactionDraft > &all, std::string &carriedBookingDate, int &nextTxIndex, core::ports::diagnostics::IErrorReporter *errorReporter, const ProgressReporter &report, std::mutex &artifactsMutex) |
| PageWork | processImportPage (size_t pageIndex, size_t totalPages, const ImportRequest &req, const core::ports::pdf_rendering::RenderResult &renderRes, const core::ports::pdf_rendering::ExtractResult &extractRes, const std::shared_ptr< core::ports::document_image_processing::IDocumentImageProcessor > &documentImageProcessor, const std::shared_ptr< core::ports::text_recognition::ITextRecognizer > &tesseract, core::jobs::SlotLimiter *ocrLimiter, const ProgressReporter &report, std::atomic< size_t > &doneUnits, size_t totalUnits, core::ports::diagnostics::IErrorReporter *errorReporter, ImportResult &out, std::mutex &artifactsMutex) |
| ColumnGuess | inferColumnModelFromLines (const std::vector< OcrLine > &lines, size_t scanN) noexcept |
| static bool | containsAny (const std::string &hayLower, std::initializer_list< const char * > needlesLower) |
Variables | |
| ParserConfig | parserConfig |
| Shared parser configuration instance used by import parsing helpers. | |
| using core::application::importing::internal::ProgressReporter = std::function<void(double, const std::string&)> |
Definition at line 29 of file ImportPipelineHelpers.h.
|
inline |
Definition at line 83 of file ImportPageRequests.h.


|
inline |
Definition at line 70 of file ImportPageRequests.h.


|
inline |
|
inline |
Definition at line 29 of file ImportPageRequests.h.


| std::vector< OcrLine > core::application::importing::internal::buildOcrLinesFromWords | ( | const std::vector< core::ports::text_recognition::Word > & | words | ) |
Builds OCR lines from raw Tesseract word output.
| words | OCR words to convert. |
Definition at line 373 of file ParserHelpers.cpp.

|
inline |
Definition at line 22 of file ImportPageRequests.h.
|
inline |
|
static |
|
noexcept |
Checks whether the text contains any short date pattern.
| text | Input text to inspect. |
Definition at line 29 of file ParserDateUtils.cpp.

| FinalizeStats core::application::importing::internal::finalizeParsedPages | ( | const ImportRequest & | req, |
| const std::vector< PageWork > & | pages, | ||
| const std::shared_ptr< core::ports::document_image_processing::IDocumentImageProcessor > & | documentImageProcessor, | ||
| ImportResult & | out, | ||
| std::vector< core::application::importing::draft::TransactionDraft > & | all, | ||
| std::string & | carriedBookingDate, | ||
| int & | nextTxIndex, | ||
| core::ports::diagnostics::IErrorReporter * | errorReporter, | ||
| const ProgressReporter & | report, | ||
| std::mutex & | artifactsMutex ) |
|
noexcept |
Finds the indices of amount-like tokens in an OCR line.
| line | OCR line to inspect. |
| valutaX | Optional currency column reference. |
| bandPx | Matching band in pixels around the reference column. |
Definition at line 38 of file ParserHelpers.cpp.


|
noexcept |
Finds and parses an amount token inside an OCR line.
| line | OCR line to inspect. |
| valutaX | Reference currency column. |
| debugOut | Optional debug output sink. |
Definition at line 230 of file ParserHelpers.cpp.

|
noexcept |
Finds the first full date in a text fragment.
| text | Input text to inspect. |
Definition at line 34 of file ParserDateUtils.cpp.
|
noexcept |
Locates the horizontal center of a multi-token phrase in an OCR line.
| line | OCR line to inspect. |
| phraseLower | Lower-case phrase tokens to find. |
Definition at line 100 of file ParserHelpers.cpp.


|
noexcept |
Locates the horizontal center of a token inside an OCR line.
| line | OCR line to inspect. |
| tokenLower | Lower-case token to find. |
Definition at line 74 of file ParserHelpers.cpp.


| std::vector< RawLineLite > core::application::importing::internal::groupMergeLinesRaw | ( | const std::vector< RawLineLite > & | lines, |
| int | maxGapPx ) |
Merges raw lines using a gap-based heuristic.
| lines | Raw lines to merge. |
| maxGapPx | Maximum gap between lines that should still be merged. |
Definition at line 527 of file ParserHelpers.cpp.

|
noexcept |
Checks whether the line contains amount-like tokens near the valuta column.
| line | OCR line to inspect. |
| valutaX | Reference currency column. |
Definition at line 149 of file ParserHelpers.cpp.


|
noexcept |
Checks whether an amount appears close to the valuta reference.
| line | OCR line to inspect. |
| valutaX | Reference currency column. |
| bandPx | Allowed band around the reference x-coordinate. |
Definition at line 184 of file ParserHelpers.cpp.

|
noexcept |
Checks whether the line contains descriptive text to the left of the valuta column.
| line | OCR line to inspect. |
| valutaX | Reference currency column. |
Definition at line 162 of file ParserHelpers.cpp.


|
noexcept |
Checks whether the text contains a short date token.
| text | Input text to inspect. |
Definition at line 20 of file ParserDateUtils.cpp.

|
noexcept |
Checks whether any token in the line is close to a horizontal position.
| line | OCR line to inspect. |
| x | Reference x-coordinate. |
| bandPx | Allowed band around the reference x-coordinate. |
Definition at line 132 of file ParserHelpers.cpp.

|
noexcept |
Infers a column layout from a set of OCR lines.
| lines | OCR lines to scan. |
| scanN | Maximum number of leading lines to inspect. |

|
noexcept |
| bool core::application::importing::internal::isDebitCreditHeaderLine | ( | const std::string & | line | ) |
Detects whether a line looks like a debit/credit table header.
| line | Input line to inspect. |
Definition at line 155 of file ParserHeuristics.cpp.
| bool core::application::importing::internal::isFooterLine | ( | const std::string & | line | ) |
Detects whether a line marks a footer section.
| line | Input line to inspect. |
Definition at line 106 of file ParserHeuristics.cpp.

| bool core::application::importing::internal::isHeaderNoiseLine | ( | const std::string & | line | ) |
Detects whether a line looks like header noise.
| line | Input line to inspect. |
Definition at line 63 of file ParserHeuristics.cpp.

|
noexcept |
Checks whether the line looks like a loosely formatted transaction row.
| line | OCR line to inspect. |
| valutaX | Reference currency column. |
Definition at line 195 of file ParserHelpers.cpp.


| bool core::application::importing::internal::isPostTransactionFootnote | ( | const std::string & | line | ) |
Detects whether a line belongs to the post-transaction footnote area.
| line | Input line to inspect. |
Definition at line 112 of file ParserHeuristics.cpp.

| bool core::application::importing::internal::isTransactionsSectionHeader | ( | const std::string & | line | ) |
Detects whether a line marks the start of the transactions section.
| line | Input line to inspect. |
Definition at line 144 of file ParserHeuristics.cpp.

|
noexcept |
Normalizes alphanumeric text to lower-case ASCII for matching.
| s | Input string. |
Definition at line 64 of file ParserHelpers.cpp.


| PageWork core::application::importing::internal::processImportPage | ( | size_t | pageIndex, |
| size_t | totalPages, | ||
| const ImportRequest & | req, | ||
| const core::ports::pdf_rendering::RenderResult & | renderRes, | ||
| const core::ports::pdf_rendering::ExtractResult & | extractRes, | ||
| const std::shared_ptr< core::ports::document_image_processing::IDocumentImageProcessor > & | documentImageProcessor, | ||
| const std::shared_ptr< core::ports::text_recognition::ITextRecognizer > & | tesseract, | ||
| core::jobs::SlotLimiter * | ocrLimiter, | ||
| const ProgressReporter & | report, | ||
| std::atomic< size_t > & | doneUnits, | ||
| size_t | totalUnits, | ||
| core::ports::diagnostics::IErrorReporter * | errorReporter, | ||
| ImportResult & | out, | ||
| std::mutex & | artifactsMutex ) |
| PageWork core::application::importing::internal::processImportPage | ( | size_t | pageIndex, |
| size_t | totalPages, | ||
| const ImportRequest & | req, | ||
| const poppler::RenderResult & | renderRes, | ||
| const poppler::ExtractResult & | extractRes, | ||
| const std::shared_ptr< core::ports::document_image_processing::IDocumentImageProcessor > & | documentImageProcessor, | ||
| const std::shared_ptr< core::ports::text_recognition::ITextRecognizer > & | tesseract, | ||
| core::jobs::SlotLimiter * | ocrLimiter, | ||
| const ProgressReporter & | report, | ||
| std::atomic< size_t > & | doneUnits, | ||
| size_t | totalUnits, | ||
| core::ports::diagnostics::IErrorReporter * | errorReporter, | ||
| ImportResult & | out, | ||
| std::mutex & | artifactsMutex ) |
Definition at line 112 of file ImportPipelineHelpers.cpp.


| std::vector< uint8_t > core::application::importing::internal::readImportBytes | ( | const std::filesystem::path & | path | ) |
Definition at line 96 of file ImportPipelineHelpers.cpp.


| std::vector< uint8_t > core::application::importing::internal::readImportBytes | ( | const std::filesystem::path & | path, |
| core::ports::diagnostics::IErrorReporter * | errorReporter ) |
|
noexcept |
Splits an OCR line into the main transaction row representation.
| src | OCR line input. |
| valutaX | Reference currency column. |
| debitX | Reference debit column. |
| creditX | Reference credit column. |
Definition at line 697 of file ParserHelpers.cpp.


|
noexcept |
Splits a raw line into the main transaction row representation.
| src | Raw line container. |
| valutaX | Reference currency column. |
| debitX | Reference debit column. |
| creditX | Reference credit column. |
Definition at line 578 of file ParserHelpers.cpp.


|
noexcept |
Converts a range of raw words into one OCR line.
| src | Raw line container. |
| i0 | Start word index. |
| i1 | End word index. |
Definition at line 550 of file ParserHelpers.cpp.


| ParserConfig core::application::importing::internal::parserConfig |
Shared parser configuration instance used by import parsing helpers.
Definition at line 12 of file ParserHelpers.cpp.