Skip to main content
1 of 3

pset5 speller (hash table) - when using large dictionary program prints "mispelled words" and has to be closed with ctrl c

When running speller with the small dictionary and ralph.txt as the text, my program correctly outputs the misspelled words and outputs the statistics (i.e. time in load, number of words in dictionary etc.). It also behaves this way for a large text (i.e. kjv).

I have also tested with a dictionary containing 2572 words and the program manages to produce a correct output for ralph. But for kjv it outputs "MISPELLED WORDS" followed by some words and then has to be ended with ctrl c.

This also happens when I run the program with the large dictionary. However, the only output is "MISPELLED WORDS" for both ralph and kjv and I have to press ctrl c to end the program (see below)

~/workspace/pset5/speller/ $ ./speller dictionaries/large texts/ralph.txt

MISSPELLED WORDS

^C

what could be the problem? Help would be very much appreciated!

(I have completed all four functions and the program passes check50 but given the output problem described above, the program can't be working correctly).