Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Text Analyzer (Python)

Python License Status

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.


πŸ“‘ Table of Contents

  • 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

✨ Features

  • 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

πŸ› οΈ Technologies Used

  • Python 3
  • String Methods
  • Dictionaries
  • Loops
  • Functions
  • File Handling

πŸ“š Concepts Covered

  • String Manipulation
  • Dictionary Operations
  • Conditional Statements
  • Loops
  • Functions
  • File Handling
  • Time Complexity Analysis
  • Space Complexity Analysis
  • Menu-Driven Programming

⚑ Time Complexity

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)

Overall Time Complexity

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

πŸ’Ύ Space Complexity

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

Overall Space Complexity

The additional memory is mainly used for:

  • Character frequency dictionary
  • Word list
  • Reversed string
  • Clean string for palindrome checking

Overall Space Complexity: O(n)


🧠 Algorithm

  1. Read the input text from the user.
  2. Split the text into words.
  3. Traverse the string to calculate:
    • Digits
    • Vowels
    • Consonants
    • Uppercase letters
    • Lowercase letters
    • Spaces
    • Special characters
    • Character frequencies
  4. Reverse the text.
  5. Check whether the text is a palindrome.
  6. Count the number of sentences.
  7. Find the longest and shortest words.
  8. Estimate reading time.
  9. Generate a formatted report.
  10. Display the report or save it as a .txt file.

πŸ“‚ Project Structure

text-analyzer-python/
β”‚
β”œβ”€β”€ text_analyzer.py
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ .gitignore
β”œβ”€β”€ sample_report.txt
β”‚
└── screenshots/
    β”œβ”€β”€ menu.png
    β”œβ”€β”€ analysis.png
    └── save-report.png

▢️ How to Run

1. Clone the Repository

git clone https://github.com/ESHRATH907/text-analyzer-python.git

2. Navigate to the Project Folder

cd text-analyzer-python

3. Run the Program

python text_analyzer.py

πŸ“Έ Screenshots

Main Menu

Main Menu


Text Analysis

Text Analysis


Save Report

Save Report


πŸ“Š Example Output

====== 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)

🎯 Learning Outcomes

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

πŸš€ Future Improvements

  • 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

πŸ“ˆ Project Statistics

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)

πŸ‘¨β€πŸ’» Author

Eshrath Jahan


πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for more details.


⭐ If you found this project helpful, consider giving it a star on GitHub!

About

A beginner-friendly project that demonstrates Python string manipulation, dictionaries, loops, functions, and file handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages