Question
Write a Java program that acts as a simple spell checker. Functional requirements Your program will open a file named dictionary.txt which is located in
Write a Java program that acts as a simple spell checker.
Functional requirements
Your program will open a file named dictionary.txt which is located in the same directory as the .class file. This file will contain a list of valid words, with one word per line. After reading the dictionary file the program prompts the user with "Please enter the pathname of the file to be spell-checked: " If the file cannot be opened, the program ends. Otherwise, the user's file is parsed into lines. Each word within a line is compared to the list of valid words from dictionary.txt. If there is no match, the program reports the misspelled word and line number. Word matching is case insensitive and ignores end punctuation. So if "dog" is in dictionary.txt, then "Dog?" is a valid word. When reporting that a word is misspelled the end punctuation should not be shown. So if "YYZ!" appears in the user's file, the program should report "YYZ misspelled on line 5".
Non-functional requirements
In addition to a main class for your application, you should write a Dictionary class, which reads data from a file and efficiently (binary search) determines whether a given work is in the dictionary. Dictionaries are immutable, so the default constructor should throw an exception; a valid dictionary is constructed using the name of a dictionary file.
You may not use generics in completing this assignment.
Write a makefile that compiles all of your .java files and also will clean (delete) all class files with "make clean".
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started