Skip to content

chetankar65/Speller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Speller

A Spell checker using C.

How it works:

It takes a file with text (say an essay or a pragraph) as its input. It produces the misspelled words and well as the number of misspelled words as output.

Efficiency:

Many of you might be thinking that those many iterations can slow down the program. Actually, we can get the efficiency to constant time, using the magical concept of hash tables. Everytime a dictionary file is loaded, we can make a special hash for each word (basically an array indice). Each array will have corresponding linked lists. As we're separating the words into different 'buckets', the number of iterations becomes considerably less. If we take an average, we can get the efficiency of the program as:

Θ(1)

( OR ) Theta(1)

Usage:

Some test files have already been given and all test cases have been passed. All of these files have been give.

The large dictionary contains upto 144,000 words.

./speller texts/lalaland.txt
./speller dictionaries/large text
./speller dictionaries/small text

Expected output:

MISSPELLED WORDS

[...]
AHHHHHHHHHHHHHHHHHHHHHHHHHHHT
[...]
Shangri
[...]
fianc
[...]
Sebastian's
[...]

WORDS MISSPELLED:
WORDS IN DICTIONARY:
WORDS IN TEXT:
TIME IN load:
TIME IN check:
TIME IN size:
TIME IN unload:
TIME IN TOTAL:



This was a part of the cs50 computer science course.

Made with ♥ by Chetan Kar.