Question: HASKELL write a function, findAnagrams A file that is a list of words, one word per line, case insensitive. The file constitutes the dictionary that

HASKELL write a function, findAnagrams

A file that is a list of words, one word per line, case insensitive. The file constitutes the dictionary that you will use for processing. The name of the file will be passed as the first parameter. The file should be a simple text file.

The word whose anagrams you are trying to find is the second parameter passed. It is also case insensitive.

Both parameters will be passed as strings

Processing - You are to read in the list of words in the file and use this as your dictionary (take that as an English word).

You are to find all words in the dictionary that are anagrams (an anagram is a rearrangement of the letters of a word) of the given word. The determination of anagrams is to be case insensitive (that is TOPS is an anagram of stop.

You are to output to the terminal by printing (not returning a value) The text The anagrams of , the word, are , and the list of all anagrams as a Haskell list, with the capitalization of the original list (that is, if it is Cat in the original file, it should be Cat in the output list. (A word is an anagram of itself,)

"Tac" The anagrams of Tac are ["Cat","Act"]

"STOP" The anagrams of STOP are ["Pots","SPOT","tops"]

"mete" The anagrams of mete are ["Meet","teem"]

"GOD" The anagrams of GOD are ["GOD","dog"]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!