A Python-based application that enables users to search through multiple text files using two different algorithms: Brute Force and Knuth-Morris-Pratt (KMP). The application provides features for case sensitivity and whole word matching.
- Brute Force Search: A straightforward approach that checks all possible positions for the search pattern.
- KMP Search: A more efficient algorithm that reduces the number of character comparisons.
- Case Sensitivity: Option to toggle case sensitivity during searches.
- Whole Word Match: Option to find whole words only, ignoring partial matches.
- Python: The primary programming language used for developing the application.
- Pandas: For handling data in tabular form (loading text files into a DataFrame).
- Tkinter: For creating the GUI (Graphical User Interface) for user interaction.
- Glob: For file pattern matching.
Make sure you have Python installed on your machine. You can download it from python.org.
git clone https://github.com/yourusername/TextSearchApplication.git
cd TextSearchApplication
You can install the necessary libraries using pip:
pip install pandas
- Ensure that your text files are named following the pattern
Research#*.txt
and are in the same directory as the application. - Run the application:
python Search_App.py
- Enter the search text in the provided input field.
- Choose the search algorithm (Brute Force or KMP) from the dropdown menu.
- Optionally, check the "Case Sensitive" and "Whole Word Match" boxes as needed.
- Click the "Search" button to initiate the search.
- The results will be displayed in the text area below the button.
- Open Command Prompt.
- Navigate to the directory where the application is located.
- Run the command:
python Search_App.py.py
- Open Terminal.
- Navigate to the directory where the application is located.
- Run the command:
python Search_App.py.py
This project is licensed under the MIT License - see the LICENSE file for details.
If you would like to contribute to this project, please fork the repository and submit a pull request.
For more code detail and working checkout the blog post here