Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Examine the file dictionary.words, which contains a list of words, one per line. Sort and put the output into a file sorted.words. Lets take the

Examine the file dictionary.words, which contains a list of words, one per line. Sort and put the output into a file sorted.words.

image text in transcribed

Lets take the last command as the crude implementation of an English spelling checker. This implementation mishandles the input file sorted.words! Write a shell script named myspell that fixes this problem. Your script should read from standard input and output misspelled words to standard output, for a suitable definition of "words". The shell command:

myspell  

should output nothing.

My question- Why does it mishandle the input of the same file? Is it because the left side for comm processes too much, beyond the right side's processing so it is too different?

Also, how could I account for these three test cases:

1: dictionary.words , should output nothing

2: list of English words without any non-alphabetical characters, and output the misspelled words.

3: number 2 with some punctuation marks, which you should be able to ignore them and output the same results as the previous case

tr -cs AZaz[ ] sort u comm - sorted.words tr-cs 'A-Za-z' '[ *]' | sort -u | comm -23 - sorted. words

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

3. What strategies might you use?

Answered: 1 week ago

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago