javascript html css frontend text-analysis

Word Count Tool

Build a comprehensive text analysis tool that counts words, characters, sentences, and provides readability metrics

โฑ๏ธ Time Breakdown

๐Ÿ“‹
Planning
~1 hours
๐Ÿ’ป
Coding
~2 hours
๐Ÿงช
Testing
~1 hours

๐Ÿ“Š Difficulty

easy

๐ŸŽ“ Learning Outcomes

  • โ€ข Working with REST APIs
  • โ€ข Managing application state
  • โ€ข Creating responsive layouts

Word Count Tool

Create a text analysis tool that provides real-time statistics as users type. Display word count, character count (with and without spaces), sentence count, paragraph count, and reading time estimates.

Project Checklist

  • Create a text input area (textarea)
  • Display word count, character count, and character count without spaces
  • Count sentences and paragraphs
  • Calculate estimated reading time
  • Update statistics in real-time as user types

Bonus Project Checklist Items

  • Add readability scores (Flesch Reading Ease, SMOG index)
  • Display most frequent words
  • Add keyword density analysis
  • Export statistics as JSON or CSV

Hint/Code snippet to start

function analyzeText(text) {
  const words = text.trim().split(/\s+/).filter(word => word.length > 0);
  const characters = text.length;
  const charactersNoSpaces = text.replace(/\s/g, '').length;
  const sentences = text.split(/[.!?]+/).filter(s => s.trim().length > 0);
  const paragraphs = text.split(/\n\s*\n/).filter(p => p.trim().length > 0);

  return {
    wordCount: words.length,
    characterCount: characters,
    characterCountNoSpaces: charactersNoSpaces,
    sentenceCount: sentences.length,
    paragraphCount: paragraphs.length,
    readingTime: Math.ceil(words.length / 200)
  };
}
โ˜ฐ

Project Requirements

Progress Tracker 0 of 7 completed

Share Project