A simple menu-driven Text Analyzer built using Python. This project analyzes user-entered text and provides detailed statistics such as word count, character count, vowels, consonants, uppercase/lowercase letters, palindrome checking, character frequency, and more.
This project demonstrates Python fundamentals including string manipulation, dictionaries, loops, functions, and file handling while maintaining an overall O(n) time complexity.
- Features
- Technologies Used
- Concepts Covered
- Time Complexity
- Space Complexity
- Algorithm
- Project Structure
- How to Run
- Screenshots
- Example Output
- Learning Outcomes
- Future Improvements
- Project Statistics
- Author
- License
- Convert text to Uppercase
- Convert text to Lowercase
- Convert text to Title Case
- Character Count
- Word Count
- Sentence Count
- Digit Count
- Vowel Count
- Consonant Count
- Uppercase Letter Count
- Lowercase Letter Count
- Space Count
- Special Character Count
- Reverse Text
- Palindrome Checker
- Find Starting Character
- Find Ending Character
- Character Frequency Counter
- Longest Word Detection
- Shortest Word Detection
- Estimated Reading Time
- Replace Words
- Save Analysis Report as a Text File
- Menu-Driven Interface
- Python 3
- String Methods
- Dictionaries
- Loops
- Functions
- File Handling
- String Manipulation
- Dictionary Operations
- Conditional Statements
- Loops
- Functions
- File Handling
- Time Complexity Analysis
- Space Complexity Analysis
- Menu-Driven Programming
| Operation | Time Complexity |
|---|---|
| Character Count | O(1) |
| Word Count | O(n) |
| Uppercase Count | O(n) |
| Lowercase Count | O(n) |
| Vowel Count | O(n) |
| Consonant Count | O(n) |
| Digit Count | O(n) |
| Space Count | O(n) |
| Special Character Count | O(n) |
| Character Frequency | O(n) |
| Reverse Text | O(n) |
| Palindrome Check | O(n) |
| Longest Word | O(n) |
| Shortest Word | O(n) |
| Reading Time Calculation | O(1) |
| Save Report | O(n) |
The program performs multiple linear traversals of the input text for operations such as splitting words, reversing the string, palindrome checking, sentence counting, and character analysis. Since each traversal is linear, the overall time complexity remains:
Overall Time Complexity: O(n)
Where:
- n = Number of characters in the input text
| Data Structure | Space Complexity |
|---|---|
| Character Frequency Dictionary | O(k) |
Word List (split()) |
O(w) |
| Reversed String | O(n) |
| Clean String (Palindrome Check) | O(n) |
Where:
- n = Number of characters
- w = Number of words
- k = Number of unique characters
The additional memory is mainly used for:
- Character frequency dictionary
- Word list
- Reversed string
- Clean string for palindrome checking
Overall Space Complexity: O(n)
- Read the input text from the user.
- Split the text into words.
- Traverse the string to calculate:
- Digits
- Vowels
- Consonants
- Uppercase letters
- Lowercase letters
- Spaces
- Special characters
- Character frequencies
- Reverse the text.
- Check whether the text is a palindrome.
- Count the number of sentences.
- Find the longest and shortest words.
- Estimate reading time.
- Generate a formatted report.
- Display the report or save it as a
.txtfile.
text-analyzer-python/
β
βββ text_analyzer.py
βββ README.md
βββ LICENSE
βββ .gitignore
βββ sample_report.txt
β
βββ screenshots/
βββ menu.png
βββ analysis.png
βββ save-report.png
git clone https://github.com/ESHRATH907/text-analyzer-python.gitcd text-analyzer-pythonpython text_analyzer.py====== TEXT ANALYZER ======
Character Count : 41
Word Count : 8
Sentence Count : 1
Digits : 2
Vowels : 11
Consonants : 18
Uppercase Count : 2
Lowercase Count : 27
Spaces : 7
Special Chars : 1
Palindrome : No
Reading Time : 0.04 minute(s)
This project helped me strengthen my understanding of:
- Python Programming
- String Manipulation
- Dictionaries
- Functions
- Loops
- Conditional Statements
- File Handling
- Problem Solving
- Menu-Driven Applications
- Algorithm Analysis
- Time & Space Complexity
- Export reports as CSV
- Export reports as PDF
- Analyze text directly from a file
- Find the most frequent word
- Find the most frequent character
- Search and count specific words
- Remove stop words
- Display text statistics using charts
- Build a GUI version using Tkinter
- Package the project as a Python application
| Property | Value |
|---|---|
| Language | Python |
| Project Type | Mini Project |
| Programming Style | Menu-Driven |
| File Handling | Yes |
| Functions | Yes |
| Dictionaries | Yes |
| String Methods | Yes |
| Beginner Friendly | Yes |
| Time Complexity | O(n) |
| Space Complexity | O(n) |
Eshrath Jahan
- GitHub: https://github.com/ESHRATH907
This project is licensed under the MIT License. See the LICENSE file for more details.


