- Dual-mode rule editing: Supports structured form mode and plain-text bulk mode (syntax:
source=replacement/source:replacement) - Smart rule expansion: Automatically expands compound rules into sub-rule combinations, supporting both Chinese and English delimiters (space /
·), improving match coverage - Trie engine: High-performance streaming text replacement based on a Trie, with longest-match-first strategy
- Web Worker parallel processing: File processing runs in a separate thread, keeping the UI completely responsive
- EPUB ebook support: Full support for importing EPUB books, replacing content in HTML, and exporting the result
- Batch file processing: Import multiple files at once for batch processing. Supported formats:
.txt.md.csv.json.epub - Split-screen preview: Side-by-side comparison of the original file and the processed result, with expand/collapse support
- Case-sensitive toggle: Switch matching mode with one click
- UTF-8 BOM export: Exported text files automatically include a BOM, ensuring Excel correctly recognizes Chinese encoding
- Bilingual UI: Supports Chinese / English switching
- Responsive layout: Side-by-side panels on desktop, tab switching on mobile
src/
├── engine/
│ ├── RuleParser.ts # Rule parser (structured/textbox interchange, compound rule expansion)
│ ├── TrieEngine.ts # Trie-based replacement engine (longest-match-first)
│ ├── worker.ts # Web Worker entry (asynchronous file processing)
│ ├── FilePreprocessor.ts # File preprocessor (encoding conversion, newline normalization)
│ └── EpubProcessor.ts # EPUB processor (parse / modify / repackage)
├── components/
│ ├── RuleEditor.tsx # Rule editing panel (structured + plain-text dual mode)
│ └── PreviewPane.tsx # File preview panel (side-by-side display)
├── App.tsx # Main application layout and logic
├── translations.ts # Internationalization (i18n) file
└── main.tsx # Application entry point
Tech Stack: React 19 · TypeScript · Vite 6 · Tailwind CSS 4 · Lucide Icons · JSZip · Web Workers
Visit the AI Studio Demo to use it online.
Prerequisites: Node.js 18+
- Clone the project and install dependencies:
npm install- Start the development server:
npm run dev- Open
http://localhost:3000
npm run build # Build to dist/
npm run preview # Preview the production buildStructured mode: Fill in source text and replacement text one by one.
Plain-text mode: Enter rules in bulk using = or : as delimiters:
Hello = Bonjour
Good Morning · Madam = Bonjour Madame
Compound rules (using · or spaces as separators) will be intelligently expanded, automatically generating forward, reverse, and segmented sub-rule combinations to significantly improve match coverage.
Click the Import button and select the text files or EPUB ebooks you want to process. You can import multiple files at once.
Click the Run button. The system will process all files in parallel inside a Web Worker. A toast notification will appear in the bottom-right corner when processing is complete.
The processed results are displayed in the preview panel on the right, with the original file and the result shown side by side. Once you confirm everything is correct, click Export to download the processed files. EPUB files will retain their original HTML structure and formatting.
- Structured rule editing
- Bulk plain-text rule editing
- Trie engine with longest-match-first replacement
- Web Worker asynchronous processing
- Smart compound rule expansion
- Full EPUB ebook support (import / replace / export)
- Batch file processing
- Split-screen preview (original / processed)
- Case-sensitive toggle
- Bilingual UI (Chinese / English)
- Responsive layout (desktop + mobile)
- UTF-8 BOM export
- Regular expression rule support
- Rule template save / import
- History