Answered step by step
Verified Expert Solution
Question
1 Approved Answer
All of this done with grep tool. Particular stuck on part D-G. 5. Finding Words in the Linux Dictionary You should find a dictionary of
All of this done with grep tool. Particular stuck on part D-G.
5. Finding Words in the Linux Dictionary You should find a dictionary of American English (word list, no definitions) at /usr/share/dict/words. If you look at the first 20 words, you will see that many of the "words" are not common words, but may include abbreviations, proper nouns, etc. Each of the following steps should be done using /usr/share/dict/words as the source for words to be found. a) Give the command to find all words of any length beginning with the lowercase letter "x". b) Observe that the output from (a) includes many cases of a word and its possessive form (eg. xenon and xenon's). Give a single command that finds the words starting with "x", but not including the possessive forms. Run the command again to get a count of the number of such words. c) Give the command to find all words of any length in which the letter "q"is followed by a letter other than "u". After you verify the output, run again to get the count - how many are there? What do you observe about all of the words found? d) Give the command to find all words of any length that contain only the vowels -aeiou. What did you find? Extend this to include x'. Give the command to do this. How many words do you find now? e) Give the command to find all 6 letter words that use only the letter 'abcdef. The letters may appear in any order, and some may appear more than once and thus some may not appear at all How many such words did you find? f) Observe that several of the words returned in (e) have double letters (e.g. accede). Starting with the command from (e), filter out the words with double letters. What is the combined filter command? How many words did you find? HINT: consider how you would find words with double letters and then use the -voption. g) Generalize 0) to eliminate all words with repeated letters, in other words each of the six letters 'abcdef may appear exactly once in the word. [In my version of the dictionary, there are none.] Try again with the letters 'aeorst'and with 'acegly. What words did you find? This can used to solve "Jumble" type puzzles. 5. Finding Words in the Linux Dictionary You should find a dictionary of American English (word list, no definitions) at /usr/share/dict/words. If you look at the first 20 words, you will see that many of the "words" are not common words, but may include abbreviations, proper nouns, etc. Each of the following steps should be done using /usr/share/dict/words as the source for words to be found. a) Give the command to find all words of any length beginning with the lowercase letter "x". b) Observe that the output from (a) includes many cases of a word and its possessive form (eg. xenon and xenon's). Give a single command that finds the words starting with "x", but not including the possessive forms. Run the command again to get a count of the number of such words. c) Give the command to find all words of any length in which the letter "q"is followed by a letter other than "u". After you verify the output, run again to get the count - how many are there? What do you observe about all of the words found? d) Give the command to find all words of any length that contain only the vowels -aeiou. What did you find? Extend this to include x'. Give the command to do this. How many words do you find now? e) Give the command to find all 6 letter words that use only the letter 'abcdef. The letters may appear in any order, and some may appear more than once and thus some may not appear at all How many such words did you find? f) Observe that several of the words returned in (e) have double letters (e.g. accede). Starting with the command from (e), filter out the words with double letters. What is the combined filter command? How many words did you find? HINT: consider how you would find words with double letters and then use the -voption. g) Generalize 0) to eliminate all words with repeated letters, in other words each of the six letters 'abcdef may appear exactly once in the word. [In my version of the dictionary, there are none.] Try again with the letters 'aeorst'and with 'acegly. What words did you find? This can used to solve "Jumble" type puzzlesStep 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