Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions Number-Guess/TextAnalyzer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
🧠 Text Analyzer — Python Project

A simple and efficient text analyzer in Python that calculates basic statistics from user-provided text, such as total words, characters, and the most frequently used word.


---

🚀 Features

Counts the total number of words

Counts total characters, both with and without spaces

Identifies the most used word in the text

Displays results clearly in the terminal



---

🧩 Technologies Used

Python 3

Standard library collections (Counter)



---

📦 Installation

1. Clone this repository:

git clone https://github.com/sheylaghost/text-analyzer.git


2. Navigate to the project directory:

cd text-analyzer


3. Run the script:

python main.py




---

🧠 How to Use

1. Run the program in your terminal.


2. Enter or paste any text when prompted.


3. View the automatically generated analysis.



Example:

🧠 Text Analyzer — Python Project
Enter or paste the text you want to analyze:

Python is amazing. Python is powerful.

📊 Text Analysis Results:
➡️ Total words: 5
➡️ Total characters (with spaces): 39
➡️ Total characters (without spaces): 34
➡️ Most used word: 'Python' (2x)


---

💡 Possible Future Improvements

Make the word count case-insensitive

Remove punctuation before counting

Calculate the number of unique words

Export results to a .txt or .json file



---

🧑‍💻 Author

Eyshila Ivanha de Brito
Created as a Python learning exercise and open-source contribution.
💬 Feel free to open issues or suggest improvements!
23 changes: 23 additions & 0 deletions Number-Guess/TextAnalyzer/Text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from collections import Counter

def analyze_text(text):
words = text.split()
total_words = len(words)
total_chars = len(text)
total_no_spaces = len(text.replace(" ", ""))

most_common_word = Counter(words).most_common(1)[0]

print("\n📊 Text Analysis Results:")
print(f"➡️ Total words: {total_words}")
print(f"➡️ Total characters (with spaces): {total_chars}")
print(f"➡️ Total characters (without spaces): {total_no_spaces}")
print(f"➡️ Most used word: '{most_common_word[0]}' ({most_common_word[1]}x)")

def main():
print("🧠 Text Analyzer — Python Project")
text = input("Enter or paste the text you want to analyze:\n\n")
analyze_text(text)

if __name__ == "__main__":
main()
Loading