Question
Could you fill this out for C#? Dictionary library. For this project, named Project1, you create software to support a software suite that will be
Could you fill this out for C#?
Dictionary library. For this project, named Project1, you create software to support a software suite that will be used to solve and create puzzles that form words from a collection of letters (e.g., Boggle, Scrabble, Wordscapes). At the core of this work will be a dictionary - EnglishDictionary - that provides basic support for word/letter operations: is a word legal? What words can be formed using a specific collection of letters?
Word lookup console application. This console app will read words typed in by the user and determine if each of the words is a real word. "Legal" means it's a real word and "illegal" means it's not. The user will type in a single line of input with all words space-separated. The following is how your program should operate (user input is shown in bold, output is shown in italics).
Enter your words: school skool Computers CLASS
school (legal)
Skool (illegal)
Computers (legal)
CLASS (legal)
Word-formation console application. This console app will read a number and a collection of letters and display (in alphabetical order and in uppercase) all words that have the given length and are composed of only the letters provided. Note: that ScrabbleWords() returns all words >= some given length. This problem requires you to display words of a specific length. So you will have to filter out some of the words returned by ScrabbleWords().
Enter a number and letters: 5 heraRTH
EARTH
HATER
HEART
HEATH
RATER
RATHE
TARRE
TERRA
Using a text file called "word.txt", your class EnglishDictionary must define the following:
public class EnglishDictionary {
public EnglishDictionary(string fileName) {
// This constructor will initiate the loading of all words located
// in the given dictionary. The constructor must return very quickly,
// perhaps before the words have been completely loaded. Tasks will be
// needed to do this. } public bool IsLegal(string word) {
// This method will return true only if the word appears in the
// dictionary. This method will need to wait, if it is called
// before the words have been completely loaded. }
public ISet ScrabbleWords(string tiles, int minLength) {
// This method will return the set of all words that can be formed using a
// collection of Scrabble tiles, that has a minimum length. Each tile can
// be used at most once but there may be more than one tile for a given letter.
// Each letter can only be used once. For example, consider the tiles: HERATH
// Here are some of the words of at least length 4 that can legally be formed:
// HEAT, EARTH, HEART, HEARTH, ...
// Some English words cannot be formed using the tiles: REATA, ARHAT
// Like the previous method, this method may need to wait too.
}
public bool Anagrams(string A, string B) {
// This method will return true if the two passed words are anagrams of
// one another. Ignore spaces. Here are some examples of how this method
// should work:
// Anagrams("income tax", "toxic name") true
// Anagrams("abcc", "cbca") true
// Anagrams("abcc", "bca") false
} }
Here's the text file:
words.txt:
School
Computers
Class
Earth
Hater
Heart
Heath
Rater
Rathe
Tarre
Terra
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