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.
914
questions
0
votes
1
answer
14
views
In pset5 speller : Two variants of same code differ in case sensitivity
//This is case insensitive as it should be
unsigned int hash(const char *word)
{
// TODO: Improve this hash function
if ((strlen(word)) <4 )
{
return (tolower(word[0]) - 'a');
...
0
votes
1
answer
16
views
PSET5 - SPELLER - CODE COMPILES BUT FAILS CHECK50
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#...
1
vote
1
answer
18
views
Unable to free up the malloc space, don't know what's going wrong in speller?
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <stdlib.h>
...
0
votes
0
answers
15
views
week 5 speller pbset issues
I tried stepping through the debugger so many times only to be dumbfounded, Im not even able to discern whats causing me to not pass the first test case, even ai cant give me a real answer. sorry for ...
0
votes
1
answer
20
views
pset5 speller - check functions seems to only return false?
so, it seems like the check() function returns false no matter what. when running debug50 it seems the cursor pointer only points at NULL, and i have no idea why and how to fix it.
additionally, ...
0
votes
1
answer
20
views
Speller valgrind test failing
I am working on the speller problem, I got every test except for valgrind to pass.
Here is the valgrind error:
running valgrind --show-leak-kinds=all --xml=yes --xml-file=/tmp/tmpbhs1m7v4 -- ./speller ...
0
votes
1
answer
21
views
Week 5: Speller. Hash function segmentation fault
after doing "speller" i got a segmentation fault. after using debug50 i managed to find out it was on the last line of the hash function. Can you please help me understand what is the ...
-1
votes
2
answers
27
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(...
0
votes
2
answers
47
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 ...
0
votes
0
answers
37
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 ...
0
votes
1
answer
15
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 ...
1
vote
1
answer
19
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 "...
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&...
1
vote
2
answers
32
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 ...
0
votes
1
answer
20
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 <...
0
votes
1
answer
119
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 ...
0
votes
1
answer
36
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>
#...
0
votes
1
answer
13
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>
...
1
vote
1
answer
47
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 ...
1
vote
1
answer
62
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 ...
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 ...
0
votes
1
answer
19
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 ...
0
votes
1
answer
34
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 ...
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 ...
0
votes
1
answer
72
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 ...
0
votes
1
answer
17
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 ...
0
votes
1
answer
57
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 ...
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 ...
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 ...
0
votes
1
answer
35
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 ...
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(!...
0
votes
1
answer
45
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 ...
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 ...
0
votes
1
answer
43
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 ...
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 -...
0
votes
1
answer
177
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, ...
0
votes
1
answer
67
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 ...
0
votes
1
answer
30
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 ...
0
votes
1
answer
77
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 ...
0
votes
0
answers
41
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.]
0
votes
2
answers
215
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 ...
0
votes
1
answer
53
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
...
0
votes
1
answer
418
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;
// ...
0
votes
2
answers
166
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 ...
0
votes
1
answer
38
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 ...
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 &...
0
votes
1
answer
53
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 ...
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 ...
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.
...
0
votes
1
answer
36
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. ...