Project Overview and Setup
Part of the Logic & Flow section of Coddy's Dart journey — lesson 51 of 65.
Welcome to an exciting multi-part project where you'll build a simple text analysis tool! This project will bring together many of the concepts you've learned throughout this course, including string manipulation, lists, sets, and maps.
Over the next several lessons, you'll create a program that can analyze any piece of text and provide useful statistics about it. Your analyzer will count characters, split text into words, find unique words, and even track how frequently each word appears.
In this first lesson, you'll set up the foundation by creating a string variable that contains the text you want to analyze. Think of this as preparing your workspace before diving into the actual analysis. You'll start with a simple task: storing your text and displaying it to confirm everything is working correctly.
This project is perfect for practicing real-world programming skills, as text analysis is used everywhere from social media platforms to search engines. Let's begin building your text analyzer!
Challenge
EasyCreate a program that sets up the foundation for a text analysis tool. This is the beginning of a multi-part project where you'll build a system to analyze text and extract useful information from it.
- Read a string input that contains the text you want to analyze
- Create a string variable called
textToAnalyzeand store the input text in it - Display a welcome header for your text analyzer
- Show the original text that will be analyzed
- Display a confirmation message that the setup is complete
For example, if the input is "The quick brown fox jumps over the lazy dog", your program should output:
Text Analysis Tool - Setup Complete
====================================
Original text loaded for analysis:
"The quick brown fox jumps over the lazy dog"
====================================
Text analyzer is ready to process your data!
Setup completed successfully.If the input is "Hello world! This is a test.", your program should output:
Text Analysis Tool - Setup Complete
====================================
Original text loaded for analysis:
"Hello world! This is a test."
====================================
Text analyzer is ready to process your data!
Setup completed successfully.Your program should store the input text in a variable and display it exactly as provided, surrounded by quotation marks. This foundation will be used in the upcoming lessons to perform various text analysis operations like counting characters, splitting into words, and finding unique words.
Try it yourself
import 'dart:io';
void main() {
// Read the input text
String? inputText = stdin.readLineSync();
// Create the textToAnalyze variable
String textToAnalyze = inputText ?? '';
// TODO: Write your code below to display the text analysis tool setup
}This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Logic & Flow
1Advanced List Manipulation
List Properties: first & lastList State: isEmpty & isNotEmpReversing a ListAdding to a List: insertList Removal: removeWhereFinding in a List: indexOfSorting a ListShuffling a ListRecap - List Organizer4Advanced Map Manipulation
Iterating Over a MapChecking for Keys and ValuesMap Properties: keys & valuesConditional Add: putIfAbsentRemoving Entries from a MapNested MapsRecap - Inventory Update2Functional List Operations
Transforming with 'map'Filtering with 'where'Using '.toList()'Checking Conditions with 'any'Conditions with 'every'Finding with 'firstWhere'Recap - Data Filtering5Project: Shopping Cart Calc
Project SetupAdding Items to the Cart8Project: Simple Text Analyzer
Project Overview and SetupCounting Characters3Sets
What is a Set?Creating a SetAdding and Removing from SetsChecking for Elements in a SetConverting a List to a SetSet UnionSet IntersectionSet DifferenceRecap - Unique Guest List