You can run the following command in the terminal: $ ./speller texts/lalaland.txt
Output would look something like this:
MISSPELLED WORDS
[...] AHHHHHHHHHHHHHHHHHHHHHHHHHHHT [...] Shangri [...] fianc [...] Sebastian's [...] ....
WORDS MISSPELLED: 955 WORDS IN DICTIONARY: 143091 WORDS IN TEXT: 17756 TIME IN load: 0.03 TIME IN check: 0.01 TIME IN size: 0.00 TIME IN unload: 0.01 TIME IN TOTAL: 0.06
TIME IN load represents the number of seconds that speller spends executing your implementation of load. TIME IN check represents the number of seconds that speller spends, in total, executing your implementation of check. TIME IN size represents the number of seconds that speller spends executing your implementation of size. TIME IN unload represents the number of seconds that speller spends executing your implementation of unload. TIME IN TOTAL is the sum of those four measurements.
In this pset, I have implemented the following functions in dictionary.c file: load. hash. size. check. unload.
Some of my own notes, while watching Week5 lecture video
- malloc: returns an addr in memory (stack)
- C symbol for storing an addr: *
- e.g. node *n = malloc(sizeof(node))
- bool check(const char *word);
- unsigned int hash(const char *word);
- bool load(const char *dictionary);
- bool check(const string word);
- unsigned int hash(const string word);
- bool load(const string dictionary);