Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help! 16.6 Homework 3b : Bloom Filter Spell Checker Using the hash function for a Bloom filter from the previous homework, implement a full

Please help!image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

16.6 Homework 3b : Bloom Filter Spell Checker Using the hash function for a Bloom filter from the previous homework, implement a full Bloom Filter to use as a spell checker. The input will be in a text file to be read in through stdin. The first line of the file will contain the number of words in the dictionary, followed by the words themselves one per line, followed by a text to spell check. You may assume that the words will all be lower case both in the dictionary and the text, and that the text has no punctuation. in the beginning once upon time in the beginning oncee upon a thyme mplement the following functions in addition to the hash function you wrote before: addWord, which adds a word to the Bloom filter, and checkWord, which checks to see if a word is in stored in the Bloom filter. When the program runs, create a Bloom filter that has 16 times as many values as there are words in the dictionary. (You can use an array of bool or a bitset to store the filter.) Add all of the words from the dictionary to the filter, and then check the words in the text using the Bloom filter. If a word is found to be misspelled, print out the word, along with the 7 hash values generated from it, and the truth values stored in the Bloom filter for each hash, on one line. To make 7 different hash functions, use the p values: 31, 37,41,43,47, 53, and 59. 16.6 Homework 3b : Bloom Filter Spell Checker Using the hash function for a Bloom filter from the previous homework, implement a full Bloom Filter to use as a spell checker. The input will be in a text file to be read in through stdin. The first line of the file will contain the number of words in the dictionary, followed by the words themselves one per line, followed by a text to spell check. You may assume that the words will all be lower case both in the dictionary and the text, and that the text has no punctuation. in the beginning once upon time in the beginning oncee upon a thyme mplement the following functions in addition to the hash function you wrote before: addWord, which adds a word to the Bloom filter, and checkWord, which checks to see if a word is in stored in the Bloom filter. When the program runs, create a Bloom filter that has 16 times as many values as there are words in the dictionary. (You can use an array of bool or a bitset to store the filter.) Add all of the words from the dictionary to the filter, and then check the words in the text using the Bloom filter. If a word is found to be misspelled, print out the word, along with the 7 hash values generated from it, and the truth values stored in the Bloom filter for each hash, on one line. To make 7 different hash functions, use the p values: 31, 37,41,43,47, 53, and 59

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

Students also viewed these Databases questions

Question

sharing of non-material benefits such as time and affection;

Answered: 1 week ago