A powerful, enterprise-grade PDF search engine that implements advanced search algorithms, data structures, and information retrieval techniques. Built as a demonstration of software engineering principles and algorithm design.
PDFScope is a command-line application that enables intelligent searching through PDF documents with support for:
- Classic Search: Multi-word independent term searching
- Boolean Search: Complex queries with AND, OR, NOT operators
- Phrase Search: Exact phrase matching
- Autocomplete: Smart search suggestions
- Spell Checking: "Did you mean?" functionality
- Result Ranking: PageRank-inspired relevance scoring
- Multiple Search Modes: Classic, Boolean, and Phrase searches
- Query Parser: Custom boolean expression parser with operator precedence
- Autocomplete: Real-time search suggestions based on prefix matching
- Spell Correction: Intelligent word similarity detection for typo correction
- Trie Data Structure: O(m) word lookup time where m is word length
- Graph-Based Ranking: Reference-aware result scoring using graph algorithms
- Persistent Caching: Serialized data structures for fast subsequent loads
- Memory-Efficient: Optimized storage using pickle serialization
- Color-Coded Output: Enhanced readability with terminal colors
- Context Display: Shows surrounding words for search matches
- Pagination: Handle large result sets with page-by-page navigation
- PDF Export: Save search results to highlighted PDF documents
- Trie (Prefix Tree): Efficient word storage and retrieval with O(m) complexity
- Graph: Page reference tracking for enhanced ranking
- Hash Maps: Fast word location lookups
- Boolean Expression Parsing: Shunting-yard algorithm for query processing
- Ranking Algorithm: Custom PageRank-inspired scoring system
- String Matching: Optimized phrase search with sequential validation
- Levenshtein Distance: Spell correction using edit distance
- Separation of Concerns: Modular architecture with clear responsibilities
- Dependency Injection: Loose coupling between components
- Strategy Pattern: Multiple search strategies (classic, boolean, phrase)
- Factory Pattern: Dynamic object creation for search results
git clone https://github.com/0vertake/PDFScope.git
cd PDFScope
pip install -r requirements.txt- AND: Both terms must appear
- OR: Either term must appear
- NOT: Exclude term from results
- "...": Exact phrase match
- *: Autocomplete suggestions
- Python 3.8+
- PyMuPDF: PDF text extraction
- ReportLab: PDF generation
- PyPDF2: PDF manipulation
- Pickle: Data serialization
| Metric | Description |
|---|---|
| Search Time | Sub-second for typical queries |
| Memory Usage | Efficient with cached structures (~5–10MB for sample PDF) |
| Scalability | Handles PDFs with 1000+ pages |
| Accuracy | High precision with ranking algorithm |
This project demonstrates proficiency in:
- Data Structures: Trie, Graph, Hash Tables
- Algorithms: Search, Parsing, Ranking
- Software Design: SOLID principles, design patterns
- Python: Advanced features, file I/O, serialization
- Testing: Edge case handling, error management
- UX Design: CLI interface, user feedback
- Clean Code: PEP 8 compliant
- Documentation: Comprehensive docstrings
- Modular Design: Reusable components
- Error Handling: Graceful failure management
- Type Safety: Clear function signatures
This project is licensed under the MIT License.
Milos Jovanovic
GitHub: 0vertake
LinkedIn: Milos Jovanovic
Email: milosjovanovic519@gmail.com
- Built as project for Data Structures and Algorithms subject
- Inspired by modern search engine architectures
- Implements algorithms from Introduction to Algorithms (CLRS)
⭐ If you find this project interesting, please consider giving it a star!