I debugged your code and I am a little bit puzzled. With your code, both large and small loaded fine and with no Segmentation faults.
I did find some lines that might cause logic error though. I am going to refer to lines based on the code block you provided. For example:
typedef struct node // line #002
trav->children[l - 'a'] = calloc(1, sizeof(node)); // line #116
1.- In the load function the code checks for a negative index when an apostrophe is found. Line 123:
else if (l == '\'' && trav->children[l - 'a'] == NULL)
l == '\'' then
39 (apostrophe's ASCII code) and
'a' is 97, so
trav->children[l - 'a'] // is the same as
trav->children[-58] // which might cause a Segmentation fault.
2.- The boolean is_word is loaded as
true in a different place than it is checked if is
true. I also noticed that all words are marked as misspelled even if you check a dictionary against itself. For example:
./speller dictionaries/small dictionaries/small
That will spell-check the small "text" against the small "dictionary". And it should show as everything correctly spelled.
I suggest you change line 123 to something like:
else if (l == '\'' && trav->children == NULL)
And line 62 to something like: