Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDFScope - Intelligent PDF Search Engine

Python License

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.


🎯 Project Overview

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

🚀 Key Features

🔍 Advanced Search Capabilities

  • 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

⚙️ Performance & Efficiency

  • 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

💡 User Experience

  • 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

🏗️ Architecture

💻 Technical Implementation

Data Structures

  • 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

Algorithms

  • 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

Design Patterns

  • 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

📦 Installation

git clone https://github.com/0vertake/PDFScope.git
cd PDFScope
pip install -r requirements.txt

🎮 Usage

Search Operators

  • AND: Both terms must appear
  • OR: Either term must appear
  • NOT: Exclude term from results
  • "...": Exact phrase match
  • *: Autocomplete suggestions

🔧 Key Technologies

  • Python 3.8+
  • PyMuPDF: PDF text extraction
  • ReportLab: PDF generation
  • PyPDF2: PDF manipulation
  • Pickle: Data serialization

📊 Performance Metrics

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

🎓 Learning Outcomes

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

📝 Code Quality

  • Clean Code: PEP 8 compliant
  • Documentation: Comprehensive docstrings
  • Modular Design: Reusable components
  • Error Handling: Graceful failure management
  • Type Safety: Clear function signatures

📄 License

This project is licensed under the MIT License.


👨‍💻 Author

Milos Jovanovic
GitHub: 0vertake
LinkedIn: Milos Jovanovic
Email: milosjovanovic519@gmail.com


🙏 Acknowledgments

  • 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!

About

Intelligent PDF Search Engine built with advanced algorithms, data structures, and ranking techniques — featuring Boolean, Phrase, and Classic search with autocomplete and “Did you mean?” correction.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages