Skip to main content

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
-1 votes
2 answers
14 views

Programme fails on freeing memory - Pset 5 (speller)

I have functioning code for Speller (problem set 5), but check50 reports a memory leak from the line table[i] = n; Compilation fails when trying to free the node in the unload function: bool unload(...
Luke Sharkey's user avatar
0 votes
2 answers
35 views

PSET 5 - Speller: Compiles locally, check50 says it doesn't

I know this is one of the most frequently asked questions here, since I' ve spent more than an hour reading posts by people that faced similar problems. But still, I can't tell what's going on in my ...
Stavros Marinos's user avatar
0 votes
0 answers
31 views

problem with speller problem set 5 code

well i have a problem with speller problem set 5 code. For some reason check50 returns everything wrong but when i debug it seems fine. I don't really know what the problem with my code is. This is my ...
dhan8293's user avatar
0 votes
1 answer
11 views

pset5 - seg fault when using large dictionaries or texts

I've been stuck on speller for a few days now, and recently I've gotten the program to completely pass check50. However, when I try to run it manually on my own, I find that the program works fine ...
Edward's user avatar
  • 3
1 vote
1 answer
16 views

Get a MISSPELLED WORD memory error from check50 PSET5

I've gone through other threads but can't find what the problem is. I don't see any errors when I run valgrind but when running check50 for PSET5 get the following error: Cause Did not find "...
faarn's user avatar
  • 13
1 vote
1 answer
25 views

PSET 5 Speller fails memory check

This is the full code: #include <ctype.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h&...
Rae's user avatar
  • 27
1 vote
2 answers
30 views

PSET 5 speller fails when solving a memory issue

Ok so when I compile the commented out part, check50 fails most of my criteria! But if I remove it, the program works but Valgrind has a frown. But when i run valgrind without the commented code, it ...
Rae's user avatar
  • 27
0 votes
1 answer
19 views

PSET 5 speller segmentation fault when trying to run

Code compiles, but when I try to run it there's a segmentation fault. Aaand I got all frowns on check50. #include <ctype.h> #include <stdbool.h> #include <stdint.h> #include <...
Rae's user avatar
  • 27
0 votes
1 answer
100 views

Valgrind output of Speller task. (debuginfo reader: Possibly corrupted debuginfo file)

I've just completed Speller task. When I run the task with valgrind on command line I encounter some kind of error, which I don't know how to deal with. I'm going to attach the error image and ...
Shahin Karimli's user avatar
0 votes
1 answer
33 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
12 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
1 vote
1 answer
44 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
1 vote
1 answer
59 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
30 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
17 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
28 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
34 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
54 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
59 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
51 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
57 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
34 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
1 answer
47 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
42 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
32 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
42 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
81 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
172 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
62 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
29 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
74 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
40 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
204 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
51 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
392 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
159 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
34 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
80 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
49 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
56 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
6k 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
33 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
33 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
116 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
39 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
135 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
128 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

1
2 3 4 5
19