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
0 answers
3 views

PS5 speller memory trouble

I have a strange problem with the below code for PS5 speller. I have can match the requested output, it is fast enough, that is all good. However I am having a persistent valgrind issue where I am ...
user avatar
0 votes
1 answer
15 views

Speller Error - free(): double free detected in tcache 2 Aborted (core dumped)

// Implements a dictionary's functionality #include <ctype.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <string.h> ...
user avatar
0 votes
0 answers
7 views

my check and size functions are having problems and check50 returns all frowns

// Implements a dictionary's functionality #include <ctype.h> #include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #...
user avatar
0 votes
3 answers
73 views

PSET5 Speller: Check50 Can't Compile: Exit code 2 vs 0

At my wit's end here. I've seen this question asked before, but I haven't really found an answer. My speller program compiles perfectly fine in the VS Code workspace. It generates the same results as ...
user avatar
0 votes
1 answer
25 views

Speller pset 5 my code is not working for substrings

I'm not sure why this is happening especially because it doesn't happen for cat #include <ctype.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <...
user avatar
0 votes
1 answer
108 views

CS50 Pset5 Help

it's my first time on here after a long time of following conversations and seeking help. In Pset5 Speller (CS50 2022), I have a weird situation. My code for dictionary.c works when I use the basic ...
user avatar
0 votes
1 answer
28 views

Speller - Doesn't work properly

I can't seem to fix this code by myself. I'm sure the main issue is in the load function, but I've changed it many times and the best I could get is a few misspelled words. I haven't even changed the ...
user avatar
  • 3
0 votes
2 answers
40 views

speller seg fault

I have been on this for literal days, there is always a seg fault no matter what i do things i have tried: debug 50: MULTIPLE TIMES, i fix the errors i find but end up with another one soon after, ...
user avatar
  • 5
0 votes
1 answer
38 views

PSet5 - Dictionary loading only one word

I've been banging my head for the last few hours as to why my dictionary function only saves one word from the whole dictionary. Even though debug50 and printf shows different hashes for different ...
user avatar
0 votes
1 answer
40 views

Speller - My code keeps failing and I have no idea why

Running my dictionary.c code against the sample text with ./speller texts/lalaland.txt shows that I have the same number of misspelled words as the staff's solution, but for some reason I only have 1 ...
user avatar
0 votes
1 answer
38 views

PSET 5 Speller - can't make load function work

I can't pass load stage and I can't check other functions as I can't seem to load the words to the hash table. I tried to see where is the issue and found out fscanf function(?) doesn't seem like ...
user avatar
  • 3
0 votes
1 answer
43 views

CS50 pset5 Speller: double free or corruption (fasttop) Aborted/ free(): double free detected in tcache 2

I get "double free or corruption (fasttop)\n Aborted" when I run my code. Somehow, only small dictionary can handle up to around 50 words perfectly but sometimes it can only handle 10 words; ...
user avatar
0 votes
1 answer
35 views

Speller perfomance question

I've completed speller and passed all checks. But I'm still bugged about the performance. I did my best with research and running tests, but my implementation is slower by 10-20% compared to staff's ...
user avatar
  • 1
0 votes
0 answers
20 views

PSET 5 speller memory won't be freed despite using free()

It seems that my program, though it compiles and begins to run, seg faults due to a memory leak acording to valgrind: ==4602== HEAP SUMMARY: ==4602== in use at exit: 4,007,248 bytes in 71,558 ...
user avatar
  • 1
0 votes
1 answer
26 views

Speller: Valgrind Still Reachable Error

after scouring the internet for multiple solutions to my Valgrind issue I cannot seem to find any that is specific to my code. I've spent hours coding this and Check50 gave me the green light except ...
user avatar
0 votes
1 answer
28 views

Pset5 Speller and the point of malloc

I'm having a really hard time understanding why we use malloc to get memory instead of just using the regular int n = 0; way. Typically when we want to make an int, we type int n; not int* n = malloc(...
user avatar
  • 101
1 vote
1 answer
30 views

Problems with Speller: Unable to Load Dictionary

Whenever I try to run my speller program, it says that it is unable to load the dictionaries (both small and large). Even when I try using someone else's code on the internet, which is supposed to be ...
user avatar
0 votes
0 answers
23 views

Pset5 speller : whats wrong with "unload" in my program? everything are right except this

the problem is: **program is free of memory errors. valgrind tests failed; see log for more information. 112 bytes in 2 blocks are still reachable in loss record 1 of 1: (file: dictionary.c, line: 6**...
user avatar
0 votes
1 answer
78 views

Speller segmentation fault

'''// Implements a dictionary's functionality #include <stdbool.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include "dictionary....
user avatar
0 votes
0 answers
37 views

Speller: Load function only reads 9 words to memory

I finished coding all functions for the pset5. However, all my tests result in the same output: Words in Dictionary: 9 It does not matter which texts I am running. But, I cannot find my fault in the ...
user avatar
  • 5
0 votes
0 answers
187 views

Why it shows "free(): double free detected in tcache 2" in speller?

I am working on pset5 and speller assignment. Here is my code: // Implements a dictionary's functionality #include <stdbool.h> #include <string.h> #include <strings.h> #include &...
user avatar
0 votes
1 answer
16 views

Clang error when compiling (Pset 5)

I tried googling this but I couldn't find (or understand) much. I'm receiving the following error when I go to make dictionary: Here is my code for the load portion:
user avatar
0 votes
1 answer
37 views

Pset 5 speller: segmentation fault for large dictionary

I can't figure out what I am doing wrong, have gone through many questions and walkthroughs of this problem and it still looks like it should be correct. It obviously is not! With a small and medium ...
user avatar
  • 5
0 votes
1 answer
35 views

I just can't figure out how to put the word into lowercase for the hash function to provide the same index

bool check(const char *word) { char mot2[46]; for (int o = 0, h = strlen(word); o < h + 1; o++) { mot2[o] = tolower(word[o]); } int y = hash(word); node *cursor = table[y]; while (cursor != ...
user avatar
0 votes
1 answer
27 views

I have no idea why my speller in pset5 is giving the wrong amount of misspelled words

I am not sure where my mistake is, I keep getting too many misspelled words. This is the link to check 50 I run on the code: https://submit.cs50.io/check50/ce552ed87b7d99ac966d9ba7a897bda34bf0a794 // ...
user avatar
  • 7
0 votes
1 answer
48 views

Program is free of memory errors, valgrind tests failed - pset5 speller

I'm am getting this error - program is free of memory errors, valgrind tests failed; see log for more information. I have tried so many things but I keep getting more errors. Here is my code: // ...
user avatar
0 votes
1 answer
78 views

Pset5 speller load

I am having an issue with my load function in pset5 speller, I really can't tell what's going on. I've gone back and rewatched the lectures and have redone my code a few times but just can't figure it ...
user avatar
0 votes
1 answer
22 views

pset5 speller Hash table not appearing in the debug50 stack/heap

This question is related with this other question of mine, in which I am trying to complete pset5: speller. I took Cliff's advice, and additionally executed the debug50 on my code. Since the original ...
user avatar
0 votes
1 answer
40 views

pset5 speller memory errors with valgrind

i've been working in pset5 and cannot make it work. I've read some similar questions and made some improvements to my code, but still can't figure what is wrong. Any tips are welcomed! Here is my code:...
user avatar
0 votes
1 answer
9k views

PSET5 compiles but gives: "free(): double free detected in tcache 2" error on testing

Been scratching my head at this for a while now. I use FREE() only once in the program, and don't know why I get this error. Any help is appreciated :-) // Implements a dictionary's functionality #...
user avatar
0 votes
1 answer
36 views

PSET5 Why Speller can't load dictionary? (included HASH function in case it's relevant)

// Load function bool load(const char *dictionary) { char word[LENGTH + 1]; FILE *file = fopen("dictionary", "r"); if (file == NULL) { printf(&...
user avatar
0 votes
1 answer
47 views

Speller not handling substrings properly

All tests seem to pass okay apart from the substrings test.The results of this test are : :( handles substrings properly expected "MISSPELLED WOR...", not "MISSPELLED WOR..." Log ...
user avatar
0 votes
1 answer
46 views

Help with check function (PSET5)

My check function is counting the right amount of words in dictionary and text, but it outputs words that are not misspelled. Here are all the functions of the problem, the arrays are used to locate ...
user avatar
0 votes
1 answer
33 views

Speller code doesn't handle apostrophes and substrings properly

this is my code: https://pastebin.com/hJfQH6Vb Any help is appreciated.
user avatar
1 vote
1 answer
62 views

Pset 5, Speller, What are the issues in my code(Check or load issues?)?

// Implements a dictionary's functionality #include <stdbool.h> #include <stdio.h> #include <string.h> #include<strings.h> #include<stdlib.h> #include <ctype.h> #...
user avatar
0 votes
0 answers
12 views

The load function in speller is returning a seg fault

I've run the debugger on my faulty program and reached the conclusion that the main that's causing the problem is among the following: while(fscanf(f, "%s", term) != EOF) { ...
user avatar
0 votes
1 answer
37 views

Speller still isn't running correctly

I rectified the earlier error in my code (putting dictionary within inverted commas). I also corrected my error in unload where the function would always return false instead of true. However, I ...
user avatar
0 votes
1 answer
52 views

pset5 - speller "double free detected" when I run check 50 but program does nothing during self tests

I am currently doing Speller. I have written all the functions and the program compiles but during self testing it is printing "misspelled words" and stays stuck at a blinking cursor. It ...
user avatar
0 votes
1 answer
32 views

Getting a segmentation fault on cs50's speller (pset5)

I would love a bit of help on cs50's pset5 speller. The program does compile. However, when I run valgrind ./speller texts/cat.txt I get a segmentation fault . I think I am overlooking something but I ...
user avatar
0 votes
1 answer
44 views

problems in unload function-pset5

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

dictionary.c - pset5 segmentation fault

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

CS50 PSET 5 SPELLER - Valgrind issues

I have been trying to figure out what is wrong with my code for a while, running through valgrind and the like. Sorry for the large wall of text, but if you could help me figure out just what one of ...
user avatar
0 votes
1 answer
60 views

Problem Set 5 - Segmentation Fault

I am trying to overcome the segmentation fault on the following code, and I couldn't manage to solve the error. Segmentation fault occurs in the load() function, and after hours of debugging, I couldn'...
user avatar
0 votes
1 answer
60 views

Where am I making a mistake?

I am solving problem set5, speller. My program is compiling correctly, but I am not sure exactly what the output is supposed to be. My program is not even getting approved from the check50. Here is ...
user avatar
0 votes
1 answer
43 views

Speller skips first word in dictionary

After chasing down and eliminating memory leaks, I think I am getting close to finishing speller. So far, valgrind says no memory leaks, and the output is formatted correctly. However, when running my ...
user avatar
0 votes
1 answer
35 views

pset5 speller all words are spelled wrong

new error: most words are seen as spelling error Here's my full code: (UPDATED) // Implements a dictionary's functionality #include <stdbool.h> #include <string.h> #include <stdio.h>...
user avatar
0 votes
1 answer
35 views

70-90 Extra Misspellings - Any ideas?

I did ask this on Ed Forums so my apologies if you're sick of seeing it - but I'm still so stuck!!! I get almost the right number of misspelled words on whatever text I use but it's off by the first ...
user avatar
1 vote
2 answers
68 views

PSET 5 SPELLER - Passing Valgrind but not Check50

I am very close to solving this, my code is returning 0 errors from Valgrind when I run that on its own, but its not passing the memory errors parameter in check50, so I'm very confused. Any help ...
user avatar
1 vote
1 answer
52 views

PSET 5 Load and Hash seg fault

I've update the code somewhat. Mostly fixing my hash function so it will run properly with non alphabetical words. Three hours into this though and I still can't seem to figure it out. I know now it ...
user avatar
1 vote
1 answer
58 views

PSET 5 Load Function woes

Back with more questions about my code. 1) fscanf: When using fscanf do we need to iterate through what it is writing to the buffer to check for the null signifier so we can jump in and strcpy that ...
user avatar

1
2 3 4 5
17