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
1 answer
30 views

HELP! Speller segfault

my speller code compiles but it gets segfault. I'm not sure where I went wrong, my guess is load but I'm not sure. #include <ctype.h> #include <stdbool.h> #include <strings.h> #...
faeyb's user avatar
  • 7
0 votes
1 answer
9 views

Speller everything works fine expect "Uninitialised value was created by a heap allocation"

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

pset 5 speller do not pass check 50

I do not know what I am doing wrong. Please, give me a hint. Here is my solution from check50: :( spell-checking is case-insensitive Cause expected "MISSPELLED WOR...", not "MISSPELLED ...
user40089's user avatar
0 votes
1 answer
45 views

pset5 speller cannot read number of word in dictionary

thank you for clicking. Being concise, I have the right solution for the pset, as evidenced down below by comparing my solution to the staff's, but check50 insists that no words have been loaded into ...
user40380's user avatar
0 votes
1 answer
29 views

Pset5 Speller - Weird Load Function Bug (Edited w/ Code)

bool load(const char *dictionary) { // TODO FILE *fdict = fopen(dictionary, "r"); if (fdict == NULL) { return false; } // create container string to hold ...
Poptart's user avatar
0 votes
1 answer
13 views

Code for pset5 compiles, but produces no OUTPUT. Seems like it is stuck in infinite loop

Description of Problem: Hey guys, so my code is outputting only MISSPELLED WORDS and then it apparently gets stuck in an infinite loop. So that I have to type ctrl + C to be able to type anything in ...
Mateus Machado's user avatar
0 votes
1 answer
24 views

Speller works fine up until a certain point

My speller program has an issue where it will find what words are misspelled properly, but it won't give the data of the amount of words misspelled/ in the dictionary/ in text. Running Check50 shows ...
esqflowne's user avatar
0 votes
0 answers
16 views

Speller big-board

How can I see where I would rank on the speller big-board? I know it doesn't exist anymore, but I'd like to see how far is my result from the best ones. I tried to write "texts/*.txt" ...
Nicolò Tiraboschi's user avatar
0 votes
1 answer
38 views

Speller Segmentation Fault Even After Freeing Malloc'd Nodes

The following is my code and, subsequently, the message Valgrind returns when I run it on ./speller texts/lalaland.txt. I explored similar issues previously posted on Stack exchange, and added lines ...
Hamster1303's user avatar
0 votes
1 answer
39 views

Pset 5: Speller - Double free or corruption (fasttop) error

Having to post a new question as the I reworked my code and space restrictions won't allow me to post it in the original thread. I changed my code based on @CliffB 's suggestion. However, now I am ...
Soumik's user avatar
  • 15
0 votes
1 answer
16 views

PSet5 Speller: What is each function in dictionary.c supposed to do? [closed]

I've started working on this PSet, and now I'm confused because in the instructions I can't figure out where it tells me what each function is supposed to do. Hash is never even called in speller.c so ...
They think im slow EH's user avatar
0 votes
1 answer
49 views

Everything is correct in my Check50 but in program I have other ERRORS - PSET05 Speller

I hope you're doing well and I also hope you might help me. When I run my CHECK50 in my speller program. Everything is correct all green, but when I run my program or valgrind I have some errors. And ...
AlvaroAndLukeTheCoder's user avatar
0 votes
0 answers
15 views

What's wrong in my Speller.c? dictionary.c Errors Help! [duplicate]

I've been doing the dictionary.c file and I've completed all the required functions. When I run ./speller texts/lalaland.txt, it prompts some misspelled words that are not in keys/lalaland.txt file, ...
AlvaroAndLukeTheCoder's user avatar
0 votes
1 answer
20 views

Pset5 Speller - trying to understand more about segmentation fault

I tested a piece of code to figure out what's causing the segmentation fault with the 'load' function. The code below opens the large dictionary. Then it scans and prints each string inside the ...
Soumik's user avatar
  • 15
0 votes
1 answer
55 views

PSET5 Speller - Problem with Check Function

There seems to be a problem with my check function that I cannot get to the bottom of. It's showing correctly spelled words as misspelled. For instance, the final check of check50 fails because my ...
Gilbert's user avatar
0 votes
1 answer
33 views

Pset5 speller segmentation fault when loading

When I run speller, I get a segmentation fault. I have played around with the code a little bit and nothing so far has changed. Using help50, this is the result I got: Looks like you're trying to ...
Team's user avatar
  • 5
0 votes
0 answers
63 views

How can I fix this double free in speller?

I've posted this question previously but I tried to post various functions from my code without posting the whole code at once, because I thought that was better etiquette or something. However, the ...
Mark Dittmer's user avatar
0 votes
0 answers
34 views

Speller: Valgrind tests fail; problem may be with load

My spell checker seems to run pretty well, except the unload function never ran properly. It compiles, but executing it prints out the misspellings but then prints the message, "double free ...
Mark Dittmer's user avatar
0 votes
1 answer
45 views

pset5 speller valgrind test fails

in check50 my code fails last test (valgrind test) fails it says: "Use of uninitialised value of size 8: (file: dictionary.c, line: 41)" i starred line 41 below, I tried both using if(!...
Emre Kırmızı's user avatar
0 votes
1 answer
33 views

PSET5 Speller case conversions

I've been struggling with writing code for case conversions in the check function to make all hash words to be lower-cased. My lack of knowledge in programming overall seems to be revealed at this ...
Jae-Min's user avatar
0 votes
0 answers
31 views

(pset5)I get a segmentation foult, even though check50 says that everything is allright

as per the title — I get a segfoult and can't check my times, even though check50 claims that the code is practically ready to submit. Here's my code, followed by valgrind results: // Implements a ...
Two-FaceFIL's user avatar
0 votes
1 answer
33 views

PSET 5 Speller Issues with Check

for Speller in Pset 5, I am having issues with my check function, not sure how to deal with words with apostrophe and need some tips if possible. The issue should be with the check function of my ...
duckpro's user avatar
0 votes
1 answer
57 views

Pset 5 Speller fscanf returning 0

for Pset5 speller my code for load along with the generation of hash codes leads to a segmentation fault. I realized it is because fscanf returns 0 after the last word of the dictionary, leading to -...
duckpro's user avatar
0 votes
1 answer
145 views

Pset5 Speller - Valgrind issue

this one was tough. But in the end my code compiles fine and has no memory leaks, the hash function isn't very good but it works. Yet I still get an error message that I just don't understand. First, ...
fth's user avatar
  • 3
0 votes
1 answer
48 views

Pset5 speller memory error --valgrind says no leaks

I almost finished pset 5 speller, I ran check50 and only the last criteria was not matched. That is "valgrind tests failed; see log for more information." The confusing thing is, when I ran ...
Eva Chen's user avatar
0 votes
1 answer
27 views

PSET5 Speller seg fault

I keep having segmentation fault in Pset5 Speller. I used debugger to find the line where seg fault happens, and it was "table[k] = n;" in function load. I don't really understand. Could ...
Eva Chen's user avatar
0 votes
1 answer
63 views

Getting segmentation fault when running speller.c

I am trying to solve speller and I always get segmentation fault every time I run it. I checked the error on valgrind and it told me that the culprit is in line 108, where I allocate a new node. How ...
IgorArnaut's user avatar
0 votes
0 answers
39 views

I'm working on pset5 - speller, it works fine when I run/test it, but when I run 'check50' it show this error. help me with this

[EDIT: Code removed for Harvard Honor Code compliance.]
Santhosh's user avatar
0 votes
2 answers
174 views

Valgrind error in pset5 speller

newbie here this is my first post, I hope you guys can help me! I am stacked with speller, my program works apparently fine but the valgrind test outputs some errors that I can't understand. I have ...
turo's user avatar
  • 3
0 votes
1 answer
50 views

pset5 speller load and hash functions

Whenever I run speller.c it appears that none of the words are getting loaded into the dictionary as the output looks like this: MISSPELLED WORDS A cat is not a caterpillar WORDS MISSPELLED: 6 ...
Sharl's user avatar
  • 3
0 votes
1 answer
295 views

Speller fclose() generates free(): invalid size error

// adding global bool value to return true if dictionary loaded and false otherwise bool loaded; // adding global int value to count amount of words loaded into dictionary int word_count = 0; // ...
Sneili's user avatar
  • 1
0 votes
2 answers
127 views

PSET 5 Speller Check50 Problem

I think I have done everything you're supposed to do in PSET5 Speller. when I manually check the outputs of my code, it works perfectly well. It matches the staff solutions one to one. Yet Check50 ...
dohaal's user avatar
  • 1
0 votes
1 answer
33 views

PSET 5 Speller Valgrind Memory

My code is functional according to check50 but I'm still leaking bad memory. Based on amount of memory lost, I'm guessing something to close up in LOAD, but could be UNLOAD as well. First thoughts are ...
mcweebus's user avatar
0 votes
1 answer
68 views

PSET5 - Speller - Valgrind returns memory leak

After many trials, I am currently stuck in this Pset. The full code that I have is as follows: // Implements a dictionary's functionality #include <ctype.h> #include <stdbool.h> #include &...
Dr. Whiskers's user avatar
0 votes
1 answer
45 views

Pset5 Speller - Got "Conditional jump or move depends on uninitialised value(s)", "Use of uninitialised value of size 8" by check50

I try my code here to solve the pset5 - speller question, it seems pretty ok with locally run my valgrind. But when I use check50 to check it. One error(and only 1) happened. I tried to assigned ...
Li-Yu Chu's user avatar
0 votes
1 answer
46 views

Pset5 Speller Issue With Substrings and Apostrophes

I'm able to compile my code for speller and it appears to work correctly. Valgrind shows that there are no memory errors. But when I run check50, I get back :( notices saying my code isn't handling ...
getsendy's user avatar
1 vote
1 answer
5k views

PSet 5 - malloc(): corrupted top size (please help)

Im having a problem at the load function wich is returning me the following message on the terminal: malloc(): corrupted top size Aborted (core dumped) Screenshot of what terminal returns to me. ...
BrazilianEnthusiast's user avatar
0 votes
1 answer
27 views

CS50 PSET 5: Returning 0 words in large dictionaries only

I've been trying to figure this out for a while now. I'm doing PSET 5 and all my dictionary words in large texts return 0, though when I've tried the small dictionary, it returns the words fine there. ...
figuringitout101's user avatar
0 votes
1 answer
31 views

How Can I Fix My Speller?

So, I have been working on Speller for at this point 40 - 50 hours at this point. However, I have not made much progress. No matter what I try to change, or try to rewrite, I always seem to run into ...
Yash-902's user avatar
0 votes
1 answer
109 views

Pset5 speller memory leak (valgrind: definitely lost)

There is a memory leak problem with my code when I ran it with valgrind.I have already check my code and passed all of them except for memory test.I am hoping someone can help me solve this problem....
mad_oreo's user avatar
0 votes
1 answer
38 views

segmentation fault from pointers

i keep getting segmentation fault when running this code. using printf i can see its from loading ala and the hashtable to store this is set to nil. other words when the hashtable to store them is nil ...
yosef's user avatar
  • 5
0 votes
1 answer
124 views

Speller works for everything but one letter words

When I run my speller program it works on everything but one letter words. I have been trying to figure this problem for a long time. I think it is a problem with either my hash or check functions. ...
Ajy_Chikn's user avatar
0 votes
0 answers
123 views

Pset5 Speller Memory Problem

I am having a memory issue with my program in speller. Check50 returns all green except for the last line which says :( program is free of memory errors expected "MISSPELLED WOR...", not &...
sage7major16's user avatar
0 votes
1 answer
41 views

segmentation fault with node pointers on speller

I know which line has the segmentation fault , if (table[hashn]->next == NULL) In this case hashn is 0 so its not exceeding the array Any ideas why its happening?
Leo8479500282664829200's user avatar
0 votes
1 answer
73 views

PSET5: Problem with my check function, but I'm not sure

I have been stuck with this problem for many hours now, but I still can't wrap the idea around my head. When I test run this code, it just prints out "MISSPELLED WORDS", and nothing more. ...
amadeus445's user avatar
0 votes
1 answer
69 views

PSET5 - SPELLER - Check50 only works locally

I am trying to run check50 on my version of speller. I worked for so long on this code. It was a battle every step of the way to get it to finally run. I finally seemingly got it today. My code works ...
ruscias's user avatar
0 votes
1 answer
20 views

pset5 speller different unload algorithms

I just finished pset5 but I had a question about why a (what i think is) recursive method doesnt work but the one i went with does. if you skip and look in unload youll see a "destroy" ...
JuneDev's user avatar
0 votes
2 answers
70 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 ...
GmasterAU's user avatar
0 votes
1 answer
1k 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> ...
incog 's user avatar
0 votes
4 answers
331 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 ...
Steedy Speve's user avatar

1
2 3 4 5
19