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
15 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 ...
0
votes
1answer
19 views

Speller code doesn't handle apostrophes and substrings properly

this is my code: https://pastebin.com/hJfQH6Vb Any help is appreciated.
1
vote
1answer
26 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> #...
0
votes
0answers
8 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) { ...
0
votes
1answer
31 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 ...
0
votes
1answer
15 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 ...
0
votes
1answer
19 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 ...
0
votes
1answer
21 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> #...
0
votes
1answer
38 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> ...
0
votes
1answer
20 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 ...
0
votes
1answer
42 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'...
0
votes
0answers
18 views

CS50 Speller: valgrind test says that bytes are still reachable in 3 blocks

I'm currently at the CS50's pset5, and am working on the "Speller" problem. I managed to do all functions and don't have any compile or runtime errors. When using check50, though, I receive ...
0
votes
0answers
22 views

My program is showing Segmentation Fault

I am working on pset5 speller. When I am running my program it is showing segmentation fault. And I am not quite sure why. Please look into it. here is my code: // Implements a dictionary's ...
0
votes
1answer
47 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 ...
0
votes
1answer
26 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 ...
0
votes
1answer
23 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>...
0
votes
1answer
30 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 ...
1
vote
2answers
50 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 ...
1
vote
1answer
51 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 ...
1
vote
1answer
44 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 ...
0
votes
1answer
29 views

Why won't my Speller correctly identify misspelled words?

See the code below. I initially had some segmentation fault issues, but now everything compiles OK and valgrind indicates no issues. However, running check50, the output indicates that my program isn'...
0
votes
2answers
38 views

pset5 speller passess all checks except valgrind. no memory leaks but errors raised. confused

// Implements a dictionary's functionality #include <stdbool.h> #include <cs50.h> #include <stdlib.h> #include <stdio.h> #include "dictionary.h" #include <strings....
0
votes
1answer
35 views

speller identifies most words as mispelled

Despite memory problems to be fixed, my code compiles fine and runs but returns almost every word that it checks as mispelled. I have spent so long looking at all this now that I am worried it just ...
0
votes
1answer
61 views

PSET5 speller segmentation fault

Can anyone help with segmentation fault. I have tried running debug50 and aparently the fault hits at line "if (head -> next != NULL)" in the load function. Aparently "table" is ...
2
votes
1answer
31 views

What is the usage of creating DICTIONARY_H in pset5?

I cann't understand when to use the preprocessor directives as (ifndef, define ,etc.)? In dictionary.h, what is the importance of writing those statements? and regarding the reason that was mentioned ...
0
votes
1answer
21 views

Why are check50 and valgrind telling different things?

When I run help50 valgrind ./speller texts/lalaland/txt it returns ==1123== ==1123== HEAP SUMMARY: ==1123== in use at exit: 472 bytes in 1 blocks ==1123== total heap usage: 143,096 allocs, 143,...
0
votes
1answer
74 views

Speller not working! What's going on?

My function returns this: WORDS MISSPELLED: 375902 WORDS IN DICTIONARY: 143091 WORDS IN TEXT: 376904 TIME IN load: 0.02 TIME IN check: 1.20 TIME IN size: 0.00 TIME ...
0
votes
1answer
25 views

Check function pset5 speller

I've been stuck on this for hours, please help. bool check(const char *word) { char check_buffer[LENGTH + 1]; for(int i = 0; i < strlen(word); i++) { check_buffer[i] = word[i]; ...
0
votes
2answers
51 views

PSET5 Speller Load function skips the words from the dictionary

Struggling with the load function in speller for second week now. What I found using debug50 and placing "printf" between different lines of code is that the fscanf reads every second word ...
0
votes
2answers
42 views

Help In Solving Memory Leak For PSET5

I need to fix the memory leak error for me to complete pset5. When running my code, I get: :) dictionary.c exists :) speller compiles :) handles most basic words properly :) handles min length (1-char)...
0
votes
1answer
39 views

PSET 5: valgrind: memory marked as 'still reachable'

fortunately I finally made it through speller. The only thing remaining is a valgrind error: ==2226== HEAP SUMMARY: ==2226== in use at exit: 8,013,096 bytes in 143,091 blocks ==2226== total heap ...
0
votes
1answer
45 views

pset 5 - speller: Hash function gets stuck with strlen() and I don't know why. Furthermore I'm lacking memory

I have several problems with my speller code and debug50 wont help me. I sat in front of it for hours now. Just want to know, where to start. Have no clue. At first Debug50 gets stuck at strlen() in ...
0
votes
3answers
55 views

PSet 5 Speller: How can the program tell if the dictionary has been successfully freed?

I'm pretty sure I'm just being dumb, but I've been wracking my brain and I'm drawing a blank. I've completed 5/6 of the functions in Speller, but the unload function has me stumped- the description ...
0
votes
1answer
31 views

Problem set 5 - is this the correct way of inserting into a hash table?

So far I've been unable to get the dictionary to load properly in the speller problem set. The goal is to insert every word from the dictionary into a hash table. Is what I'm doing in the the line ...
0
votes
2answers
49 views

Speller.c, get correct result on my machine, wrong on check50

Good day, I am struggling with speller.c. When I run the program on my machine I get the correct result compared to the keys but then when I use check50 to check I get all wrong. I have narrowed the ...
0
votes
1answer
83 views

Output in Speller.c seems to match the staff solutions, but cannot seem to pass check50

This is what I happen to get when I run check50, which is weird, because when I do manual tests, I seem to match the keys. Other posts make me think this might be an issue of using the incorrect slug? ...
0
votes
1answer
32 views

pset5 - speller - recursion

// Implements a dictionary's functionality #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include "dictionary....
0
votes
1answer
37 views

Pset 5 speller load function and word

I'm working on my load function to obtain the "word" from dictionary and I obtain one of the next message dictionary.c:59:28: error: use of undeclared identifier 'word'; did you mean 'load'? ...
0
votes
0answers
25 views

CS50 Speller (trie) - getting issues with apostrophes and substrings

searching for help with the task pset4/speller (using trie) :( handles words with apostrophes properly expected "MISSPELLED WORD...", not "MISSPELLED WORD..." :( handles ...
0
votes
2answers
72 views

Pset5 Speller,Check function isn't working as expected, strcasecmp always returns false

The problem is the word is found in loaded dictionary it's found but check function still returns false i've been like 7 days in this problem someone helps please, ((I'm Trying to test code ./speller ...
0
votes
1answer
22 views

Somehow I don't have any output when I run check50 on speller

After running check50, I got these results. https://submit.cs50.io/check50/0298620e7f016e3485ce95bb4bebaac5f12abbfd I'm not sure how come there are no outputs at all according to the link above. Here'...
0
votes
1answer
35 views

speller is case sensitive

I tried to convert each word to lower before hashing in check, but it seems like it didnt do anything :( however, in the output the misspelled word is now lower // Implements a dictionary's ...
0
votes
1answer
56 views

PSET5/Speller - Valgrind error: conditional jump, relates to table[i] array, but I've already initialized that (or have I?)?

I posted something similar a couple of days ago but have made progress since then. Specifically I found a couple of posts answered by Cliff B indicating the problem users had was that they hadn't ...
0
votes
1answer
18 views

speller getting different hashes in check and load

using some printf statements to debug it seems that when I hash a word in my load function I get a different value then when I hash it in my check function, even when the words are the same case. I'm ...
0
votes
1answer
26 views

speller returning a segmentation fault, unclear why

this is my dictionary.c implementation. I think the problem is speller since I've been printing my hash values from hash. I also have not yet implemented unload since I think I'm having some ...
0
votes
1answer
23 views

My program tells me there are no words misspelled when I use the large dictionary, although the small dictionary with cat.txt seems to work fine

My code passes all the check50 checks, apart from a small amount of memory leak (I think I'm unnecessarily allocating memory to my temporary nodes). When I run the small dictionary with cat.txt, it ...
0
votes
2answers
36 views

In PSET5/ Speller - Unload Valgrind says Conditional jump or move depends on uninitialised value(s)

So my code passes all the Check50 tests apart from the memory one. I have been playing around with this for ages, but don't understand what the problem is. Here's what valgrind says. And here's the ...
0
votes
1answer
34 views

My Code compiles but I am getting a leak "8,013,096 bytes in 143,091 blocks are still reachable in loss record 1 of 1"

I see that valgrind is saying that the leak is happening at malloc but I am not sure how to free it seeing where it is allocated (within loop). Please help. ''' // Implements a dictionary's ...
0
votes
1answer
31 views

speller: Testing myself works but check50 says it's producing no output

I have tried testing my code normally with the provided dictionaries and texts, and it seems to work, producing the expected results in a reasonable amount of time. However, when I use check50, it ...
0
votes
1answer
23 views

Pset 5- Output is correct but still cant pass check50

I am currently working on Pset5, Speller. My output seems to be identical with cs50's solution (mine is simply way slower), but I still can't pass check50, it simply shows a blank window for my output....

1
2 3 4 5
17