I am working on a HOMEWORK assignment to spell check a file, and output any misspelled words. As this is something that I will be graded on, I am NOT asking you do "do it all for me" I am asking for hints and help so that I may continue to learn (and get a good grade at the same time)
The way it is set up, a good chunk of the code is written already, There is a file called speller.c, that uses functions that I have to write. The functions actually get written in a different program called dictionary.c. Both dictionary.c and speller.c are compiled together.
The functions I have to write are:
//Returns true if word is in dictionary else false.
//Loads dictionary into memory. Returns true if successful else false.
//Returns number of words in dictionary if loaded else 0 if not yet loaded.
//Unloads dictionary from memory. Returns true if successful else false.
I am currently working on writing my psudocode, and I have a few questions about the best way to do things...
- What is the best way to load the dictionary into memory, and what should it be loaded into... An array, hash table, trie.... Also, I have used the "f" functions before(fread, feof....), but there are so many to choose from, I am not sure what one(s) would work best.
- Is there an "f" function that can be used to return the size of the dictionary??? I don't want to know the total number of letters, but the total number of words. Is it best to find the size of the original dictionary or, the one that is loaded into memory.
Any hints/help related to these questions or anything else to do with my program, would be great!!!