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
1answer
11 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
14 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
0answers
8 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
10 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
15 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
25 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
22 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
15 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
36 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 ...
0
votes
2answers
19 views

Speller Valgrind Issues

I've been trying to finish up the speller pset, and while everything works well, I keep getting a memory leak. When I rerun check50 with --log, I get: checking for valgrind errors... 56 bytes in 1 ...
0
votes
1answer
16 views

PSET5 Speller - Can't handle substrings properly

I've been doing the speller exercise for a while and I'm stuck in the "handle substrings properly". Here's my code: // Implements a dictionary's functionality #include <stdbool.h> ...
0
votes
0answers
27 views

Almost Done… But substrings

// Returns true if word is in dictionary else false bool check(const char *word) { //Variables bool looping = true; int hashWord = hash(word); //Create a new pointers node *head = table[hashWord]; ...
0
votes
1answer
35 views

Pset5: Speller. incorrect counting of mispelled words

I've been working on this code for the last two weeks... I load the correct # of words into the dictionary, but I get an incorrect number for misspelled words. I believe its an issue either with my ...
0
votes
2answers
23 views

Pset 5 Help understanding Valgrind output

I was wondering if anyone could help me with interpreting the Valgrind error to trouble shoot. There are no memory leaks, but I am getting this error "Conditional jump or move depends on ...
0
votes
1answer
18 views

pset 5: Repeat Until?

Trying to read strings from file in the [load] function of speller. When using fscanf(), how do I start a while loop until it returns "EOF"? I think there's got to be an easy way to do this, ...
1
vote
2answers
31 views

Valgrind issue on PSET5 - Edited

sorry that this is a repost of a deleted question. I made a mistake in reading the specifications and didn't realise I wasn't able to alter the function declarations in dictionary.c & .h. The ...
0
votes
1answer
26 views

PSET 5 Speller- all words misspelled + memory leaking issues :(

I've tried fixing this problem for a while now, but I can't seem to figure it out. There are two main issues I am having: Firstly whenever I try running my code "./speller texts/lalaland.txt"...
0
votes
2answers
40 views

Pset 5 Speller - Load function crashing at strcpy?

My program compiles, but in debug50 it seems to get caught in a loop during the first strcpy in load. Any suggestions would be great thanks. // Implements a dictionary's functionality #include <...
0
votes
2answers
51 views

Pset5 Need help, the program doesn't work correctly and I can't find the bug

I have been all day trying to find the bug in my problem but I find it impossible. The program runs correctly at first but the misspelled words are not the ones expected, and then suddenly there is a ...
0
votes
1answer
36 views

PSET5 Speller everything works but then I catch all the words as misspelled

Basically when I run the test with texts/lalaland.txt and compare to the staff's key, they have something like 955 misspelled words and I have all but 5 misspelled. I tried to but a "tolower"...
0
votes
1answer
35 views

Pset5 Speller - Valgrind displays no leaks but code fails check50

any help would be much appreciated - I've been trawling other questions similar to this one but all the adjustments I have tried to make don't seem to fix the check50 failure. The code seems to run ...
0
votes
1answer
25 views

PSET5: Trying to implement dictionary.c using trie. But segmentation fault in check()

My implementation compiles but I am getting a segmentation fault when I execute. My program is working fine through the load function because the output screen shows this "~/pset5/speller/ $ ./...
0
votes
1answer
34 views

PSET5 Compiling issue

So I finally finished my code and received 20 errors when attempting to compile, after my first attempt fixing the errors I tried again and received 15 errors, once more and received 17, and now am ...
0
votes
1answer
48 views

CS50 pset5 segmentation fault

I've spent a whole day trying to solve pset5. When i try to run the code it kept showing "Segmentation fault". Here's what i get from Valgrind ==21210== HEAP SUMMARY: ==21210== in use at ...
0
votes
1answer
43 views

Pset5 speller getting valgrind error

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

What is causing segmentation fault? I ran valgrind and help50 nothing seem to come up

help50 output: valgrind output: my code: // Implements a dictionary's functionality #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include &...
0
votes
1answer
23 views

pset5 speller: valgrind 937 errors from 1 context

I have done check50 and the only error is "valgrind tests failed; rerun with --log for more information". I can't find the source of the memory leak and I thought that my unload made sense. ...
0
votes
0answers
51 views

PSET 5 SPELLER - HELP!

i'm not sure why this happens when I execute the code. The program seems to never end as if it's running an infinite loop. When I run valgrind on it misspelled words keep spewing out and it gives me a ...
0
votes
1answer
28 views

PSET 5 SPELLER - seg fault

I need help with my unloads function. I keep getting a segmentation fault on "while(cursor->next != NULL)." When I hover over the "cursor->next" part it says no value. I don'...
0
votes
1answer
21 views

PSET 5 SPELLER - segmentation fault

I keep getting a segmentation fault on my load function when using the debugger. Specifically, the line with "if(table[num]->next != NULL)" is what is causing it. I need some help, please....
0
votes
1answer
37 views

pset5 valgrind tests failed

I'm very close to completing pset5; all smiley faces except the Valgrind memory leak. I'm hoping someone can help find the problem. I am only leaking 112 bytes and have tried to fix the issue by ...
0
votes
1answer
35 views

pset5 speller - valgrind & case sensitivity

So valgrind has identified line 102 as the potential source of memory leak which is the following within the load function: node *n = malloc(sizeof(node)); Have I missed freeing up this memory later ...
0
votes
1answer
16 views

Pset5 : Valgrind seg fault in load function

Currently doing the pset5, and keep getting seg fault when running Valgrind. This is the error messsage I get: /etc/profile.d/cli.sh: line 94: 1150 Segmentation fault valgrind ./speller texts/...
0
votes
1answer
20 views

Pset5 segmentation fault with table variable

My code compile but when I try to run it, I get a segmentation fault with this line if (table[x] != NULL) Here is the code of the load function bool load(const char *dictionary) { int i; for (...
0
votes
1answer
62 views

Speller beyond my reach: all words marked as misspelled

The spectre of Speller is haunting me. The code below compiles fine, but comes a cropper in at least two ways - first, it marks all words as misspelled (is my hash function flawed? or am I loading ...
0
votes
1answer
58 views

All misspelled words on pset5 speller

i'm having some trouble with speller, my code seems to detect words in dictionary and words in text fine, based off of check50 results, but for each check it seems all of my words come back as ...
0
votes
1answer
30 views

pset5 Speller: dictionary loads, but text will not

Hello Stack Exchange Team. I am having an unusual issue that I am not sure how to tackle. I am working on the problem set speller. I have written all of my code into dictionary.c as instructed. I ...
0
votes
1answer
35 views

PSET 5 My hash table doesn't seem to be storing correctly

When I load the dictionary, I add the words to the hash table, by calling the hash function to calculate the bucket ID, then add hash function to actually insert it into the list. Inside the addhash ...
0
votes
1answer
31 views

My code matches the outputs in the keys, but does not pass check50

The code is here: // Implements a dictionary's functionality #include <stdbool.h> #include "string.h" #include <strings.h> #include <ctype.h> #include <cs50.h> #...
0
votes
1answer
56 views

PSet5 Speller, passing test cases but not check50

I'm implementing the most basic form of the speller function, using 27 buckets for A-Z and ' (apostrophe) . My code works for the test cases (i.e. the generated results match those in keys/) but when ...
0
votes
1answer
61 views

PSET 5 Speller Failing free memory of errors final check

So i am so close to finally completing this present and i still have some final errors to go through. Valgrind is saying that it is still leaking memory for some reason and i cant find the reason why. ...
0
votes
0answers
14 views

One block still reachable plus other advice

I am trying to do pset5 speller and am running into a lot of problems Can't figure out what the problem is here. https://pastebin.com/fBkFeDA9 Also saw that the hash function is giving out negative ...
0
votes
1answer
80 views

PSet5, Speller, all correct but problem with Valgrind

I am so close to finally finishing Speller, however I'm running into an issue with Valgrind that I don't understand. I was under the impression that when I malloc a node for the dictionary table in ...
0
votes
0answers
20 views

all my speller words are misseplled

// Implements a dictionary's functionality #include <stdbool.h> #include "dictionary.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <...
0
votes
2answers
29 views

strcpy not working with struct items

bool load(const char *dictionary) { char splitStrings[9999][45]; FILE* dict = fopen(dictionary, "r"); node* item = table[0]; int i = 0; for (i = 0; fscanf(dict, "%...
0
votes
1answer
21 views

dictionary is allways null

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

pset5 speller, passes all Check50 requirements except the last one (Valgrind)

My code is now working fine but misses out on fully completing Check50 because of the last requirement. Running ~/pset5/speller/ $ help50 valgrind ./speller texts/cat.txt, it returns: ==6259== ...
0
votes
1answer
36 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
42 views

Pset5 Speller: every word in text reported as misspelled

Code compiles, dictionary loads and unloads, word count works and hash function seems to work. However, the results show that every word in the text is misspelled. I’ve spent 3 weeks tweaking the code ...
0
votes
1answer
22 views

Speller Valgrind error uninitialized variable

#include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> #include <string.h> #include <strings.h> #include "dictionary.h" // Represents a ...

1
2 3 4 5
15