Questions tagged [speller-load]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
53 views

Segmentation Fault on Speller's Load function

bool load(const char *dictionary) { FILE *dict = fopen(dictionary, "r"); if (dict == NULL) { return false; } char word[LENGTH + 1]; while (fscanf(dict, "%s&...
0
votes
1answer
45 views

pset5 speller load - i don`t get it

how do i check the logic of this ... i have not yet implemented the hash function ... can i check for errors without doing this or it is impossible to check without the hash function...? // Loads ...
0
votes
1answer
21 views

cs50 Speller Question

I am currently working on the load function in Speller. When I run it with a file, most of the words are mispelled, leading me to believe that initializing my list works correctly, until it adds ...
0
votes
0answers
42 views

PSET5 dictionaries won't load

I cannot get my dictionaries to load and cannot figure out why. Here is my load function: // Loads dictionary into memory, returning true if successful else false bool load(const char *dictionary) { ...
0
votes
1answer
38 views

PSet5 Speller, Load Function, help50 Valgrind returns “==2480== Conditional jump or move depends on uninitialised value(s)” at the strcpy line

I've been working on Speller for a while now, but I've been stuck on this same problem. When testing my code by running ./speller texts/ANYOFTHETEXTS, it says I load 143092 words, but it also always ...
0
votes
1answer
32 views

speller giving error on valgrind, using 4 bytes of memory that isn't yours…indexing an array out of bounds

I think the problem with is the load() function, here is my code: bool load(const char *dictionary) { char *s = malloc(LENGTH + 1); FILE *f = fopen(dictionary, "r"); if (f == NULL) { return false;...
0
votes
1answer
100 views

pset5 speller-“Could not load dictionaries/large” even without “return false” in load

I typed in the command window './speller texts/cat.t' The window print out 'Could not load dictionaries/large.' I've made all the 'return false' in load comments. I don't understand why it can still ...
0
votes
1answer
79 views

Pointer initialization in Load function (pset4 Speller)

When in my load function, I insert a node at the front of a linked list: If I declare and initialize a pointer as the new 'head' node, my code compile but every word in the text is found to be ...
0
votes
1answer
505 views

Pset4 Speller load() function

So I am currently working on Pset4 speller and implementing it using hastable. I have written the load() function but I am not sure if it's correct as you need to compile speller.c and not dictionary....
0
votes
1answer
49 views

Speller load() seemingly overwriting each word value

I think my load function is pretty close, but I cannot seem to get it to work properly, I built a function to read the data and I saw it's only storing one word in each bucket. Any ideas on what's ...
0
votes
1answer
13 views

Speller - Where to place struct

Speller pset: I am working on building a trie for the dictionary (load). In order to do so, I know I need to create the struct node. I thought that this was supposed to go in the dictionary.h file ...
0
votes
2answers
186 views

pset5 Speller -load - Valgrind error - “invalid read of size 8”(segmentation fault)

i have been trying to figure this out but need some help! even a hint will do... //trie node typedef struct trie_node { struct trie_node* parent; struct trie_node *child[27]; //check is ...
0
votes
1answer
65 views

pset5/speller incorrectly identifies correctly spelled words

I do apologise for the unspecific question, however I have been slaving away at this problem set for almost two weeks and have only just managed to get code that compiles. I have reached my wits end. ...