Questions tagged [speller]

speller.c is one of the files that make up Problem Set 5, but it is already written by CS50 Staff and you may not alter it! Instead, you must implement your solution by altering three other component files: dictionary.c, dictionary.h, and Makefile.

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

Problem freeing memory in Speller hash function

I have a problem to free the memory for the variable lowercaseword, I try to do it above the return statement with free(lowercaseword), but then the program stops working and I get errors on check50. ...
0
votes
1answer
22 views

(Speller) Search Function returns each word given as false, And when i run Small Dictionary gives me Segmentation Fault

// Implements a dictionary's functionality #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include <ctype.h> #...
0
votes
1answer
28 views

“Could not unload” error in pset4 speller

I am solving speller pset5. In check50 my code is wrong. Don't know why. dictionary.c:// Implements a dictionary's functionality #include <stdbool.h> #include <strings.h> #include <...
0
votes
0answers
14 views

PSet 5 Speller - Valgrind Segmentation Fault

I keep getting a hit on valgrind. It says to check line 99 but I know I free(cursor) before the end of the block :-( my entire code
0
votes
1answer
37 views

Word array sometimes filled with weird values - Speller

My code looks like this: (ignore the comments; they're old) // Implements a dictionary's functionality #include <stdbool.h> #include <string.h> #include "dictionary.h" #include &...
0
votes
1answer
12 views

Memory Leak Even Though Memory Freed - Speller

The error specifically refers to line 36, which is when memory is allocated to the node pointer "temporary" in the check function. At the end of the function, I am still freeing the code, ...
0
votes
1answer
13 views

PSet 5 Speller - Expected Identifier

Been stuck on Speller for 2 days and could really please use some help. My initial idea is just to create an array of linked lists with 26 buckets (N = 26) and very simply hash the words by only the ...
0
votes
1answer
15 views

The strcsecmp() function is not working as expected

I am currently trying to solve pset5, speller. I managed to write every funtion correctly except of the check() function. This is the check() function I wrote so far: // Returns true if word is in ...
0
votes
0answers
14 views

Speller - Compiles but Doesn't Hit Criteria for Completion

I've been having a lot of trouble with Speller. This compiles but almost all the criteria are red, for example it doesn't basic words properly, doesn't handle 1 char words or long words, etc. I'm not ...
0
votes
1answer
23 views

Hash Function in Speller - Use of Undeclared Identifier Error

I'm stuck on the speller assignment but it feels like the smallest thing to be stuck on....in my hash function I keep getting "use of undeclared identifier" for n and i. Usually if this ...
0
votes
1answer
24 views

Pset5: check returns hashtable pointers as NULL despite hashtable values printed correctly in load

My check function returns all hashtable indexes as NULL (I printed a known index of 124 and still returns NULL), despite all indexes printed correctly in load. I am not sure where exactly the problem ...
0
votes
1answer
19 views

Errors with Valgrind on Speller (Still Reachable) - PSET5

I am almost done with speller but when I pass it through valgrind, it says there are some mistakes. More specifically, it says a bunch of bytes are still reachable. I don't know whether my problem is ...
0
votes
1answer
23 views

When declaring an array of pointers that will be a hash table, do you have to set all the elements of the array to NULL?

In the distribution code for Speller in pset5, they include this line in dictionary.c // Hash table node *table[N]; Should I set every element in the array to NULL, because they are pointers? (the ...
0
votes
1answer
33 views

Struggling with PSET5 Speller valgrind problems (& possibly more)

I've been working on PSET5 for weeks now on & off and I'm becoming really frustrated. I think I'm lacking some understanding of the malloc/free relationship, I'm not sure. Here's all of my code. ...
0
votes
1answer
20 views

pset5 speller check function: cursor pointer keeps being NULL

I finished writing the code and tried to run the program, but it returned all words as misspelled. When I ran debug50 on the check function, it shows that the cursor pointer does not take the value of ...
0
votes
1answer
18 views

Trying to fix a segfault in unload , pset5, speller

So when I originally wrote my code for the dictionary.c, I forgot to create the header nodes for each 'bucket' in the hash table. It ran well when every first node of each linked list had a letter, ...
0
votes
0answers
16 views

trouble loading dictionary

my load function seems to only load two words and all words are coming back misspelled. I don't know if the problem is with my load function or the hash function. I've gone over the load function ...
0
votes
1answer
25 views

Speller skips last word in testfile I use

The title speaks for itself, but here is a bit more in-depth explanation. While my check() function runs, it always skips the last word in whatever file it is checking out. The source code for my ...
0
votes
1answer
29 views

CS50 Speller Not Free of Memory Errors

When I run check50 on my code, valgrind says: Conditional jump or move depends on uninitialised value(s): (file: dictionary.c, line: 34) 112 bytes in 2 blocks are still reachable in loss record 1 of 1:...
0
votes
2answers
39 views

Segmentation fault error in pset5

I did the speller and had some errors that I solved, but now I'm stuck and need help. I debug the load and hash (I know it's not ideal, but it works:)) Now I'm receiving the Segmentation fault error ...
0
votes
1answer
36 views

pset5 speller check50 error - code doens`t handle max length (45char)

i get this error from check50 and i can t figure out why...: :( handles max length (45-char) words expected "MISSPELLED WOR...", not "MISSPELLED WOR..." everything else is green (...
0
votes
1answer
26 views

speller - unload returns false …?

unload returns false and i am not sure why.... when i run Valgrind i get this: HEAP SUMMARY: ==7885== in use at exit: 608 bytes in 2 blocks ==7885== total heap usage: 143,096 allocs, 143,094 ...
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
35 views

Pset5 Speller Issues with check and unload functions

I have been stuck on this pset for over a week now. I have already checked other answers to similar questions here but none have been helpful to me. Testing through check50 as well as the debugger I ...
0
votes
1answer
29 views

cs50 speller code complies and run also successfully. but it not qualifying for big board

:) dictionary.c and dictionary.h exist :) speller compiles :( qualifies for Big Board expected exit code 0, not 139 :| passes benchmarking can't check until a frown turns upside down how to fix this *...
0
votes
0answers
39 views

CS50 pset5 Speller - Code Does Not Compile Due to Issue with Hash Table/Load Function

I've been working on Speller for a little while now, but I've run into a roadblock. I finished my first draft of speller and have been clearing up errors until this point. Here's my dictionary.c so ...
0
votes
1answer
22 views

CS50 Pset 5 Speller Can't Handle Substrings

For some reason, when I run check50 cs50/problems/2020/x/speller, it says that my code can't handle substrings, but everything else works. My code recognizes that there are 2 words in the dictionary, ...
0
votes
1answer
30 views

Can anyone see what is wrong with my check function?

#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <ctype.h> #include <strings.h> #include "dictionary.h" int s = ...
0
votes
1answer
23 views

pset5/speller Check produces a segfault if I introduce hash function

If I have a single bucket, the program runs seamlessly, however when I introduce the djb2 hash function as seen here the program produces a segfault. Here's my code with the hash function commented as ...
0
votes
1answer
27 views

I can't assign a node to a bucket in a hash table with with right assignment of pointer and word values

When I assign table[index3] = n; what happens is that the value of the word receives a memory address and I can't follow table[index]->next to achieve the old n->word; This shouldn't happen. // ...
0
votes
0answers
26 views

code can't handle substring property

// Implements a dictionary's functionality #include <stdbool.h> #include "dictionary.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype....
0
votes
1answer
32 views

the misspelled words are more than expected

misspelled words in my code is seemed to be 2678 while the correct number is 955 some words like "and", "but", "a", "an" my code regards them as misspelled ...
0
votes
1answer
43 views

CS50 Pset5 Speller

I am having problems with Pset 5 Speller. I believe, I'm nearly there, I can get all functions to run and compile successfully, however my outputs are not quite right. I have attached comments to make ...
0
votes
1answer
33 views

Pset5 Speller. Treating the letter 's' as a valid word when using large dictionary?

I'm very puzzled my program seems to work correctly apart from one thing, when I run speller with large dictionary, the letter "s" is treated as a correctly-spelled word. I ran a test using ...
0
votes
2answers
51 views

CS50 Speller returns all word as mispelled and I can't find any mistake in my code

I need help, I can't get around this problem set. I have searched everywhere and I think the code is equal to most of the other students... The problem is that the check function is returning true ...
0
votes
1answer
29 views

Pset 5 Speller: Could not load small

I don´t know what may be happening with my code. When I run it without any dictionaries it runs (although is also not able to open cat.txt), but when I try to run it using small it could not load it. /...
0
votes
1answer
26 views

pset5 speller “Could not load dictionaries/large” error

#include <ctype.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include "dictionary.h" #define ...
0
votes
0answers
33 views

CS50 Speller valgrind issues and

I'm new to CS and could really use some help on the speller pset. I've got a basic outline that doesn't seem to seg fault, but I'm still having issues. It fails check50 in that: it doesn't handle ...
0
votes
1answer
30 views

recursive function on speller causing a “conditional jump” error on valgrind?

I am trying to implement a recursive subfunction for speller. It works, but when I run check50, I'm told that there is a "Conditional jump or move depends on uninitialised value(s): (file: ...
0
votes
1answer
17 views

Struggling to understand file I/O

everyone. I'm just starting my journey in learning to code, starting with C. And for the past few months, I've been struggling to understand file I/O. More often than not, I don't get the output I'm ...
0
votes
1answer
51 views

I dont understand valgrind pset5

Error from valgrind $ valgrind ./speller texts/cat.txt ==1453== Memcheck, a memory error detector ==1453== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==1453== Using Valgrind-3.13....
3
votes
2answers
82 views

Debug50 is not functioning properly

I was using debug50 over and over for pset5 speller and at some point it just stopped working. Now when I try to use it with simple programs it still won't work. I've restarted the ide from inside ...
0
votes
1answer
80 views

Pset5 - Speller - memory leak?

My programme runs and I'm passing all the checks bar the last one. When I run the check with --log I get this response: :( program is free of memory errors valgrind tests failed; rerun with --log ...
0
votes
1answer
27 views

My program is not free of memory errors Speller Pset 5. Can anyone help?

I am working in Speller of PSET5. My program compiles and only has one problem :( program is free of memory errors valgrind tests failed; rerun with --log for more information. The rest of the ...
0
votes
0answers
27 views

pset5 - Conditional jump or move depends on uninitialised value(s)

Here is my code: // Implements a dictionary's functionality #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include ...
0
votes
1answer
40 views

Exit code 139 for big board speller

Hello I am able to pass normal check50 but it fails to pass check 50 for the big board challenge: here are some details: :) dictionary.c and dictionary.h exist :) speller compiles :( qualifies for Big ...
0
votes
1answer
43 views

Help with speller

I have been trying to solver spell checker but my program crashes with a segmentation fault. Valgrind gives me the following errors: https://codeshare.io/5Ddk6m Here's my code: https://codeshare.io/...
0
votes
1answer
50 views

Speller pset 5: Valgrind gives me error

I am doing pset 5 speller and It seems to be okey less valgrind check. Valgrind HELP50 gives me these errors ==22585== Use of uninitialised value of size 8 ==22585== at 0x40110B: hash (dictionary.c:...
0
votes
1answer
74 views

PSET 5 Speller - Unload leaking a ton of memory

I've been trying to read other questions on stack exchange about it and do research on it but I really couldn't find a solution for my unload problem. It doesn't seem to unload much. I tried a lot of ...
0
votes
1answer
66 views

Please help! I'm stuck on Pset5 Speller!

#include <stdbool.h> #include <stdlib.h> #include "dictionary.h" #include <string.h> #include <stdio.h> #include <ctype.h> int wordCount = 0; // Represents a ...

1
2 3 4 5
16