Find Jobs
Hire Freelancers

develop a simple spelling checker

$15-25 USD / hour

Closed
Posted almost 8 years ago

$15-25 USD / hour

This programming homework is to develop a simple spelling checker. The file [login to view URL] the documentView in a new window contains 25,025 frequently used words, each on a separate line in lowercase. Read the file, and insert the words into a hash table with 1373 buckets. Prompt for the name of an input text file to check. Read the document, and separate it into a sequence of words converted to lowercase. Use [login to view URL] (Links to an external site.) as an example way to convert. Using a hash table/function, print out a list of words that appear to be misspelled. A hash table contains buckets into which an object (data item) can be placed. When a hash function is applied to an object, a hash value is generated. The hash value is used to determine which bucket the object is assigned to. Hashed associated containers in STL have a constructor that takes the number of buckets and guarantees the bucket count will be at least that number. A bucket is a cluster (or a sub container) that holds a set of data items that hash to the same table location. Obviously, you can not store 25K words in 1373 slots and you need to use some kind of chaining schemes such as linear probing or the second hashing. The size of a bucket is independent from the number of data items you put into the hash. So if you have too many buckets, the hash will not have many collisions but you may waste the storage and you may have to deal with a rather complex hash function and longer keys. If you have too small number of buckets, then you have to deal with frequent collisions. Finding a good bucket number would play an important role in reducing collisions. That's why we usually pick a prime number for the number of bucket. We picked 1373 for the bucket number. You can use an STL for this project. and [login to view URL] (Links to an external site.) To set the hash you might use .hash_function() and to set the hash table size, you would use .rehash(). Like a vector note that the [ ] operators are assigned. Note that you still have to deal with collisions (either with linked lists or vectors) OR you take the easier way (less learning, but more practical) using [login to view URL] (Links to an external site.) (Make sure to compile with std=C++11). This auto increases the size of the buckets so you won't have collisions. OR You can implement your own hash, based on the textbook implementation but you need to come up with a scheme to include buckets (clusters) and collision resolution. Hash set from STL makes this very easy by using a constructor with a bucket value, although the exact bucket count may be reevaluated and altered by the library (it's OK for the homework. you don't have to constrain the program to use 1373 buckets) If you're implementing your own hash, here's a sample function to create a key from a string. Basically it uses a prime number and the character ascii values for the % function. class HFstring { public: unsigned int operator()(const string& item) const { unsigned int prime = 2049982463; int n = 0, i; for (i = 0; i < [login to view URL](); i++) n = n*8 + item[i]; return n > 0 ? (n % prime) : (-n % prime); } }; You don't have to interpret verb tense, plurals, conjugations etc. All you have to do is to check with each word with the dictionary.
Project ID: 10273028

About the project

8 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
8 freelancers are bidding on average $18 USD/hour for this job
User Avatar
I am compiler expert, I made our own script. I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 6 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environment. I used c++ to make many great projects, for example, I made the tools which can convert java files into c++ scripts, of course garbage collection included, this job is very similar to a compiler, and is very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
$20 USD in 5 days
4.9 (134 reviews)
6.9
6.9
User Avatar
Hi, I’ve had a good look at your project description and I’m very interested in providing a solution. I am a preferred freelancer on freelancer.com within 1 year of my work on freelancer.com due to my skills and I have more than 4+ years of experience in c++ programming and algorithm building, so I can easily provide you with all of your desired work within a week with all of your requirements.
$15 USD in 40 days
5.0 (22 reviews)
4.9
4.9
User Avatar
Hi, client. I am a C++ programmer and mathematician. Please check my Profile/RecordList and consider hiring me. Looking forward to your response. Thanks.
$25 USD in 20 days
4.9 (26 reviews)
4.5
4.5
User Avatar
Hello, I am proposing the unordered_multiset implementation. This will result in a reliable implementation with just a few hours of development. Please don't hesitate to ask any questions. Regards, Yiannis
$15 USD in 10 days
5.0 (2 reviews)
2.4
2.4
User Avatar
Being a Masters student i solved hundreds of such assignments over the past 4+ 2 years. I rest my case here!
$15 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hey , I have a very good proficiency in both english and hindi And i have strong knowledge of programming in c and c++. i have good practice of data structures and apart from that I am a software developer for one of India's leading E-commerce company. so i think i would be the right choice for this project .so this work shouldn't be a lot of work and your project will be delivered to you well within time I have only started bidding on freelancer so i am willing to do this for free and only for a fair review . Really looking forward to hear from you . Thanks
$16 USD in 10 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
denver, United States
5.0
7
Member since Apr 20, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.