How it works: This tool counts words, finds patterns, and shows you statistics about your text. Just paste text below and click Analyse.
Analyse your text in seconds
# Text Analyzer in Python
import re
from collections import Counter
class TextAnalyzer:
def __init__(self, text):
self.text = text
self.words = self._extract_words()
def _extract_words(self):
words = re.findall(r'\b[a-z]+\b', self.text.lower())
return words
def word_count(self):
return len(self.words)
def unique_words(self):
return len(set(self.words))
def most_common_words(self, n=10):
word_freq = Counter(self.words)
return word_freq.most_common(n)