Questions tagged [load]

the first part of pset5, loading a dictionary into memory

81 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
2answers
92 views

2019 PSET4 SPELLER, I have no clue why it isn't working, I'm sure size and unload function is right, but unsure about load and check

// Implements a dictionary's functionality #include <ctype.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #...
1
vote
1answer
397 views

Help with PSet 5 Load Function

I hope you are well. I am currently on pset 5 where you have to write a spell checker. I am stuck on the load function. I am able to get stuff into my linked list. when I make and run it, I get a ...
1
vote
1answer
64 views

Using gdb for load function in speller

I am trying to figure out if all my words of the dictionary are uploaded in my declared node* hashtable[100]but when I am using gdb its just giving me the hexadecimal address of the nodes, be it a ...
1
vote
0answers
135 views

Problem in pset5 load

I've been stuck on pset5 load for a while now (like 1 month...) and I've advanced quite a lot but I'm so close to completing it but, unfortunately, I've reached a bit of a dead end when it comes to ...
1
vote
1answer
531 views

Pset5 Speller load() function completely stuck (trie)

I am completely stuck on pset5 load() function, have no idea where to go. Can someone please guide me in the right direction? Here is my code: bool load(const char* dictionary) { // TODO FILE* file = ...
1
vote
1answer
330 views

PSET5 - Issues with initialization of pointers in LOAD function

I'm still trying to debug my load function, I rewrite my code again and again but with no result... I know we need to have specific question, but now I just have so many questions. So, I'll go with ...
1
vote
1answer
225 views

PSET5 How can I test my code with small dictionary?

I'm trying to test my implementations of LOAD and CHECK with small dictionary of cs50 appliance, but it's look like I do the wrong thing... Someone can help me with that please! Thanks jharvard@...
1
vote
1answer
434 views

PSET5 How can CHECK have access to the loaded dictionary?

I'm now working on the implementation of CHECK subfunction. I think I'm on the good way, but my major problem at this moment is to link CHECK with the loaded dictionary. I'm pretty sure I can't access ...
0
votes
2answers
56 views

Pset5 - Speller - Valgrind error for malloc in load function

I get all test results correct except the Valgrind error as follows, does anyone know why is it so and share some insights please? thanks! running valgrind --show-leak-kinds=all --xml=yes --xml-file=/...
0
votes
0answers
19 views

trouble loading dictionary

my load function seems to only load two words and all words are coming back misspelled. I don't know if the problem is with my load function or the hash function. I've gone over the load function ...
0
votes
1answer
19 views

My load function is licking memory

the program complies properly but when i use valgrind shows am leaking memory when I open the file in the FILE *file = fopen(dictionary, "r"); bool load(const char *dictionary) { // TODO ...
0
votes
0answers
20 views

Pset5: Problem with loading multiple words with the same hash number

I am having problems with loading multiple words with the same hash code. The hash function I chose, from what I can understand, takes the ascii codes of all of the words in the dictionary, and ...
0
votes
0answers
66 views

CS50 pset5 Speller - Code Does Not Compile Due to Issue with Hash Table/Load Function

I've been working on Speller for a little while now, but I've run into a roadblock. I finished my first draft of speller and have been clearing up errors until this point. Here's my dictionary.c so ...
0
votes
1answer
21 views

cs50 Speller Question

I am currently working on the load function in Speller. When I run it with a file, most of the words are mispelled, leading me to believe that initializing my list works correctly, until it adds ...
0
votes
1answer
55 views

Speller pset 5: Valgrind gives me error

I am doing pset 5 speller and It seems to be okey less valgrind check. Valgrind HELP50 gives me these errors ==22585== Use of uninitialised value of size 8 ==22585== at 0x40110B: hash (dictionary.c:...
0
votes
0answers
42 views

PSET5 dictionaries won't load

I cannot get my dictionaries to load and cannot figure out why. Here is my load function: // Loads dictionary into memory, returning true if successful else false bool load(const char *dictionary) { ...
0
votes
1answer
68 views

Speller week 5 Segmentation fault

I can't understand where and what my error is I think it's because of "load", but I can't fix it it returns an error when checking :) dictionary.c, dictionary.h, and Makefile exist :) ...
0
votes
2answers
86 views

strcpy not working with struct items

bool load(const char *dictionary) { char splitStrings[9999][45]; FILE* dict = fopen(dictionary, "r"); node* item = table[0]; int i = 0; for (i = 0; fscanf(dict, "%...
0
votes
0answers
39 views

pset5 speller issue

#include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include "dictionary.h" #include "string.h" #include <cs50.h> #include <strings.h> typedef struct node { ...
0
votes
0answers
24 views

Pset5 - Segmentation fault (Load function) - Using a for loop to make all elements of table[i] = NULL

The following is my load function and I am having a segmentation fault when I run the executable code by typing for example when I type ./speller texts/aca.txt When I run debug50, it is pointing to ...
0
votes
1answer
30 views

Pset5 load problem: Dictionary cannot be loaded

I run my code and it cannot load the dictionary. I'm not sure if the problem is with my code or the file location. Anybody knows why? Thanks in advance.
0
votes
1answer
101 views

Pset5 Speller returns all words misspelled and seg faults

I'm completely lost on this one. I can't see a problem with my check function but it never returns a match when using strcasecmp. I think the problem is probably in load() but I really have no idea ...
0
votes
0answers
37 views

Help on Pset5 Speller

bool load(const char *dictionary) { // Open dictionary FILE *dict = fopen(dictionary, "r"); if (dict == NULL) { printf("Could not read.\n"); return false; } ...
0
votes
1answer
95 views

pset5 - almost all words misspelled

I'm having trouble with the implementation of the PSET5 spell check code. I've looked through a lot of CS50 Stack Exchange posts, but haven't found any help. The problem is either in the check or in ...
0
votes
1answer
45 views

Help with speller load function on PSET4

I have been stuck on pset4 for quite some time without any meaningful progress. After re-watching the walkthroughs and reading answers here I've sort of put together a "frankenstein" thing for the ...
0
votes
1answer
77 views

Declaring a node (a struct pointer) from a function

I'm tackling load and decided to make a create_node function for allocating memory, NULLing all children and setting is_word as false. What I wrote is essentially the same as in this question struct ...
0
votes
0answers
46 views

PSET 4 - Speller The load function

I am implementing a trie and I can't figure out the load function. I can't understand how do I put the letters into the trie other than the first trie. So, far I have only figured out this much ...
0
votes
1answer
39 views

All words are returned misspelled

I'm running this program on a small dictionary and a small text sample. I think that loading the dictionary is working correctly. But how can I know for sure? When I implement the load and check ...
0
votes
1answer
392 views

How can I debug my load() function in Speller?

So I have code that I feel as though should be working, but I'm having trouble checking my work. I wrote a function that I think loops through my table, but it only displays half of the data seemingly....
0
votes
1answer
55 views

Segmentation fault in pset5/speller while linking newNode with the linked list

I have been trying to resolve errors in my speller "load function". I have been able to resolve a couple of them except this one. Debug50 reveals that while creating a link between new Node and the ...
0
votes
1answer
298 views

pset5 speller trie load - Dictionary not loading

I am working through pset5 using the trie data structure and it has been very challenging. I finally have code that compiles but when I run it against cat.txt using the small dictionary it returns all ...
0
votes
0answers
62 views

Printf prints newline character instead of string in Pset5

I'm working on the Speller program in Pset5. As always, i'm using a modular approach to construct all the required constituent functions one by one. However, something quite odd is happening in my ...
0
votes
1answer
46 views

For the spell checker, isn't the dictionary data structure only made of local variables?

For the spell check program, we have to read the dictionary from a file into a data structure (e.g. linked list, hash table with linked lists, a try). However, we have to do this within the function ...
0
votes
1answer
77 views

PSET5. Free a variable outside a loop. leaking memory

I've been stuck for days in the implementation of LOAD with a TRIE data structure. I think my code works (well it doesn't show seg faults) but I am getting a lot of memory leaks. I implemented the ...
0
votes
1answer
139 views

i don`t know what is wrong with my unload function?

enter code here /** * Implements a dictionary's functionality. */ #include <stdbool.h> #include<cs50.h> #include <strings.h> #include <stdio.h> #include <...
0
votes
1answer
37 views

c9 CS50 Loads but doesnt show terminal or workspace

Hey i've doing the cs50 course on Cloud9.io but now whenever i load the IDE it loads but doesnt show the terminal or the workspace, I cannot click any of the buttons on the top bar (file, edit, find, ...
0
votes
0answers
45 views

Pset5 Speller Tries: How do I copy a character from word into children?

I am using Tries to load dictionary into memory and I am stuck trying to copy characters from the source word into children[] that is part of a new_node structure definition: typedef struct node { ...
0
votes
1answer
362 views

Pset5 Speller Load - Segmentation Fault - Valgrind error: Invalid read of size 8

this is my first post to this forum so I hope I've followed correct procedure. I get a segmentation fault when I run speller. Valgrind says the problem is "Invalid read of size 8" at line 114 in the ...
0
votes
1answer
483 views

Pset5 speller trie

There is a problem with my load function which i cannot wrap my head around. I can run speller however because of this one problem, my misspelled words is always more than the actual value. What is ...
0
votes
1answer
123 views

STUCK ON LOAD FUNCTION SPELLER.C/PSET5

I am stuck on load function does compile but doesn't load the dictionary.Any suggestions will be appreciated!
0
votes
1answer
158 views

Problem in load function

Why does the code in the wile loop inside the load function only get executed once? /** * Implements a dictionary's functionality. */ #include <stdbool.h> #include <stdio.h> #include &...
0
votes
0answers
22 views

I cannot get the right output.I think the problem is with load fuction,create function inside it

bool load(const char *dictionary) { ptr2=(node*)malloc(sizeof(node)); if(ptr2==NULL){ printf("error\n"); return false; } /* allot space for hashtable*/ for(int i=0;i<26;...
0
votes
1answer
362 views

Pset 5 Load Function

I'm having trouble with my load function... I had it working previously, but after changing some stuff and dealing with the check, I ran into this issue and can't seem to figure it out... Every time ...
0
votes
1answer
133 views

pset5 speller load, please let me know if this makes sense

I'm having a really hard time with pset5.. I think I 'vaguely' understand the flow from the walkthrough, but it's really difficult for me to implement it in code.. I tried to 'collage' every element ...
0
votes
0answers
126 views

pset5 load() and unload()

I need some help in spotting where is the problem in my load and unload functions and if the logic is correct. Also, whenever I execute valgrind and its telling me: definitely lost: 8,013,040 bytes in ...
0
votes
1answer
103 views

Trouble with Substrings in Check in Pset5

I have used a trie structure to implement my dictionary in pset5 and I believe my load() function is operating correctly, however I seem to be having trouble with checking substrings in the check() ...
0
votes
1answer
60 views

Pset5 problem with load function : Keeps getting segmentation fault

I have been working on pset5 and i keep getting segmentation fault while trying to implement 'load' function. I cannot really see where is the problem. Any help will be really appreciated! Here's my ...
0
votes
1answer
72 views

Load and server not working, am confused

Am really trying to solve server.c though I don't really understand the specification for load and indexes functions. My parse and lookup seems to be working well, they passed check50 for server1 ...
0
votes
1answer
297 views

pset5 load with a trie Killed

I'm having a lot of trouble with my pset5. I'm attempting to use a trie to load the dictionary. It will compile but nothing really more than that. when using gdb, the program shows "Killed" in the ...
0
votes
1answer
91 views

Logic Error in speller.c - Can't open text file and also have doubts about load() and check()

I wrote check() and then I tried to test speller with dictionary/small and a text file I'd written myself, but the text file couldn't be opened. Is there a problem with the way I implemented load() ...