$ show TheJoeFin/Text-Grab
Text-Grab is a Windows desktop application for capturing and extracting text from screen regions, images, PDFs, and barcodes using on-device OCR (Windows OCR, Tesseract, Windows AI) and UI Automation. It provides multiple capture modes (fullscreen grab, grab frame, edit text window, quick lookup) and offers post-capture features like text editing, table analysis, unit conversion, expression evaluation, template-based extraction, text-to-speech, and clipboard integration. The application is privacy-focused as all processing runs locally. It is built as a monolithic WPF application using .NET 10 and WindowsAppSDK, with extensive unit and UI automation test coverage. The codebase is well-structured with reusable utility classes and custom controls, though some files (e.g., EditTextWindow) are very large and tightly coupled. The repository is actively maintained with recent commits, CI/CD pipelines, and dependabot integration.
The LLM identified 5 files worth highlighting for reuse:
A static utility class offering rich string analysis: character type detection (digit, letter, separator, punctuation), cursor word boundary extraction, number-letter error correction, regex escaping, pattern explanation, and pattern generation at multiple precision levels. Self-contained with no internal dependencies, easily extractable for any text processing tool.
A model that generates a regular expression pattern from a sample text string, with six precision levels (0-5) controlling specificity. Useful for extracting similar data from structured text. Demonstrates well-thought-out pattern construction heuristics and is independent of the rest of the application.
An expression evaluation service using NCalc with added support for percentage parsing, quantity words (million, dozen), date/time math, and unit conversions (length, mass, temperature, volume, speed, area, pace). Includes operator continuation ('5 km\n+ 3 km') and 'to' syntax for conversions. Self-contained service with well-structured extensibility.
A generic undo/redo stack with transaction support and capacity trimming. Handles grouping of operations into atomic transactions, boundary trimming, and state management. Implements a clean IUndoRedoOperation interface. Could be reused in any application needing undo/redo functionality.
A utility that detects changes in screen content by comparing thumbnail images using Magick.NET's Compare method. Used to determine when a screen region has stabilized before OCR. Provides a general-purpose pattern for image-based change detection, reusable for screenshot automation or UI testing.