Questions
In this exercise, you will build a basic spell checker. Write a module called spell_checker.py. Your...

In this exercise, you will build a basic spell checker.

Write a module called spell_checker.py. Your module should contain the following functions:

  1. word_correct(string) -> string
    word_correct() takes in a string consisting of one word. It searches for the line in aspell.txt containing that word and replaces it with
    the first word present in the file. If the word is not in the file, it returns the same word back.

    For example,
    word_correct("cookie") = "cookie"
    word_correct("acommadate") = "accommodate"
    word_correct("basically") = "basically"

    Note that if the correction does not exist in aspell.txt, you will still have an incorrect word.
  2. line_correct( string) -> string
    line_correct() takes in a string consisting of a line of words. It goes through each word in the line and corrects it using word_correct().

    For example,
    line_correct("can you acommadate") = "can you accommodate"

  3. file_correct ( string) -> nothing
    line_correct() takes in a string that is the name of a file. It goes through each line in the file and corrects any spelling errors. It prints the results to a "corrected" txt file. For example, if the file's name is "file.txt", the corrected file should be called "file_corrected.txt"

You may use "blurb.txt" to test out your module.

In: Computer Science

express in 200 word what is highway pavment design and how effect the environment in simple...

express in 200 word what is highway pavment design and how effect the environment in simple word

In: Civil Engineering

Name a type of document that can be created with Microsoft Word.


Name a type of document that can be created with Microsoft Word. Using what you have learned from practice, describe the functions of Microsoft Word that aid you in creating the document you named. Describe how you would use the Word functions for creating your document.

In: Computer Science

Name a type of document that can be created with Microsoft Word. Using what you have...

Name a type of document that can be created with Microsoft Word. Using what you have learned from practice, describe the functions of Microsoft Word that aid you in creating the document you named. Describe how you would use the Word functions for creating your document.

In: Operations Management

Question # 4. (a) Determine the number of ways to rearrange the letters in the word...

Question # 4.
(a) Determine the number of ways to rearrange the letters in the word QUESTION.

(b) Determine the number of ways to rearrange the letters in the word BOOKKEEPERS.

(c) Determine the number of ways to rearrange the letters in the word SUCCESSFULLY, assuming that all the Ss are kept together, and the E and F are not side-by-side

In: Statistics and Probability

Write a recursive method using Java that takes a string s as input and returns a...

Write a recursive method using Java that takes a string s as input and returns a list that contains all the anagrams of the string s. An anagram is a word formed by rearranging the letters of a different word. For instance, the word ‘cat’ is an anagram of ‘act’. Notice that the output list cannot contain duplicates.

In: Computer Science

A 12-bit Hamming code word containing 8 data bits and 4 parity bits is read from...

A 12-bit Hamming code word containing 8 data bits and 4 parity bits is read from memory. What was the original 12-bit word written into memory, if the 12-bit word read were the following?

(i) 000011101010

(ii) 101110000110

(iii) 101111110100

In: Electrical Engineering

Jenson grew up with beagles, which he first learned to associate with the word "doggie." Even...

Jenson grew up with beagles, which he first learned to associate with the word "doggie." Even as an adult, Jenson still thinks of a beagle upon hearing the word "dog." To him, a beagle is an example of a ______________ for the word "dog."

A. Mental set

B. Algorithm

C. Prototype

D. Heuristic

In: Psychology

Solve using PYTHON PROGRAMMING 9. Write a script that reads a file “ai_trends.txt”, into a list...

Solve using PYTHON PROGRAMMING

9. Write a script that reads a file “ai_trends.txt”, into a list of words, eliminates from the list of words the words in the file “stopwords_en.txt” and then

a. Calculates the average occurrence of the words. Occurrence is the number of times a word is appearing in the text

b. Calculates the longest word

c. Calculates the average word length. This is based on the unique words: each word counts as one

d. Create a bar chart with the 10 most frequent words.

Solve using PYTHON PROGRAMMING

In: Computer Science

The syntax of the monkey languages is quite simple, yet only monkeys can speak it without...

The syntax of the monkey languages is quite simple, yet only monkeys can speak it without making mistakes. The alphabet of the language is {a, b, d, #}, where # stands or a space. The grammar is

<stop> ::= b|d

<plosive> ::= <stop>a

<syllable> ::= <plosive>|<plosive><stop>|a<plosive>|a<stop>

<word> ::= <syllable>|<syllable><word><syllable>

<sentence> ::= <word>|<sentence>#<word>

Using parse trees, which of the following speakers is the secret agent masquerading as a monkey?

Chimp: abdabaadab#ada

Baboon: dad#ad#abaadad#badadbaad

In: Computer Science