2 votes
Accepted

I don't get these errors

I'll pick one. // Adds word to list void append(const char *word, node *list) What is this meant to do? I guess you pass a word and the pointer to the list head, and expect a new node to be added to ...
user avatar
  • 20.7k
1 vote
Accepted

dictionary is allways null

this is problematic fread(dict, 1, 999999, fopen(dictionary, "r")); you can read one word at a time with fscanf, keep reading it in a loop until fscanf returns EOF.
user avatar
  • 450
1 vote
Accepted

trie speller check() function no mispellings

Your code is returning true if the first few characters form a valid word, ignoring the rest. The code if (current->is_word == true) { return true; } should be after the loop,...
user avatar
  • 20.7k
1 vote
Accepted

PSET 4 - Speller Load Function giving SEG Fault at strcpy("cursor->word", word);

Remove the quotation marks around cursor->word. "cursor->word" is a pointer to some read-only location where exactly those characters ({'c', 'u', 'r', ...}), together with a null terminator, are ...
user avatar
  • 20.7k
1 vote
Accepted

trie speller works on custom dict but misses mispellings on large dictionary

if (i == l - 1) { cursor->is_word = true; } would have to go behind cursor = cursor->children[n]; because otherwise you ...
user avatar
  • 20.7k
1 vote
Accepted

pset4 speller (hash) - check50 showing "handles substrings properly"

You have a "small" problem in check function, you actually go through the entire hash table without finding any match. What happens if strcasecmp () is zero? Why do you keep moving forward in the hash ...
user avatar
  • 5,172
1 vote
Accepted

Speller (hashtable) check-function marks everything as correct

I took a very quick glance at it and see this: if (strcmp(word, wordcheck->word)) { return true; } This tells me that you've assumed that strcmp returns true/...
user avatar
  • 63.1k
1 vote

When I run valgrind, why do I see more allocs than the number of times I've malloc'ed memory?

Your size function shouldn't call the load function.
user avatar
  • 18.3k
1 vote
Accepted

do not understand why check function checks new word against dictionary

No, not at all. You're conflating two different var names to be the same variable. Let's look at the code: // Returns true if word is in dictionary else false bool check(const char *word) { ... if ...
user avatar
  • 63.1k
1 vote
Accepted

pset4 speller unload trie leaking memory

What's n meant to represent? Your recursive function is looping from 0 to n to unload the children, but n isn't the number of children, N is.
user avatar
  • 18.3k
1 vote
Accepted

Pset4 speller segmentation fault in check functions when using larger files like holmes.txt

You're on the right track. The problem is definitely within the hash function. I added a printf statement to print every word being checked to find out which word was triggering the seg fault. The ...
user avatar
  • 63.1k
1 vote
Accepted

I keep getting the message that 'non-ASCII characters are not allowed outside of literals and identifiers.'

This has to be one of the most unique syntax errors I've seen in a while! You get today's award for something almost never seen! ;-) Let's look at one of the lines that are causing the problem: ...
user avatar
  • 63.1k
1 vote
Accepted

Speller is returning all the words as misspelled while using a hashtable?

Here's the main issue that's blocking your progress: if (ptr -> word == wordt) Your goal is obviously to see if the words are the same. Unfortunately, this will compare addresses in memory, ...
user avatar
  • 63.1k
1 vote
Accepted

valgrind() causing IDE to shut down

The result of the comment discussion as an answer. I still have no idea why the IDE would time out, I am guessing valgrind had a hell of a job counting all the occasions where you read from ...
user avatar
  • 20.7k

Only top scored, non community-wiki answers of a minimum length are eligible