Questions tagged [dictionary]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
1k views

PSET5 Dictionary - error : Could not open texts files

I have a problem to open texts files related to pset5. I think that is nothing to do with my code. It's probably the way I ask in the command window or maybe my current directory. Is it the good way ...
1
vote
1answer
328 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 ...
0
votes
1answer
200 views

PSET5 - CHECK returning… nothing?

I have one more questions about SPELLER. I've completed all my codes for load, check, size and unload. I'm now trying to debug all of them. It appears I have an error with my check function, which one ...
1
vote
1answer
222 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
432 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
1answer
195 views

PSET5 What LOAD really supposed to do?

I'm starting Problem Set nb 5 and just need a couple more specifications to begin my implementation of LOAD. Is it good to assume that a lexicographically sorted dictionary corresponds to a ...
0
votes
1answer
141 views

Segfault in check

I just moved on to pset5 and am finding a little difficulty. I believe I have implemented the correct code for dictionary.c but having searched through, I am getting a set fault during check. ...
0
votes
0answers
159 views

pset5 load/check: seem to be inadvertently freeing my hashtable

I think I've implemented load in a (mostly) correct way. For the most part it seems to be sorting and loading into the hashtable correctly but I'm not sure. The problem I'm running into is that I ...
0
votes
1answer
1k views

pset5: dictionary not loading correctly

I took a bit of a break from cs50 and having come back to it I realised that there is a problem with my load function in pset5. Although the program tells me correctly which words are misspelled, the ...
0
votes
1answer
32 views

Valgrind is saying strange things

I have implemented a trie whose leaf nodes branch off into linked lists that contain possible word endings, because I wanted to see if this would take less time to load. It does take less time to ...
0
votes
1answer
491 views

Pset5: problem with inserting words into nodes

To start off, I'm not even sure if the reasoning behind this is correct because I felt totally lost at the beginning of the pset, but the program won't even compile because of this error: ...
1
vote
2answers
599 views

pset5 speller valgrind still reachable

I'm using a trie data structure to tackle the spell checker. The code works fine and is almost as fast as the staff's implementation. Even check50 is happy about it. But when I run valgrind it throws ...
0
votes
2answers
102 views

Dictionary.c problems (still not working)

My code works fine when I don't use the large dictionary, but when I do use it, I get a segmentation fault. When I use GDB, the problem is so far into the dictionary that it would take forever to get ...
0
votes
1answer
146 views

pset5 dictionary.c not working

In my dictionary.c file, I declared my own function called trieNavigate(), whose code is below. I use it for loading and for checking, and so it returns a bool and accepts 3 parameters: a char (that ...
0
votes
2answers
296 views

Invalid read/write errors in pset5

I have been trying to create a trie for storing my dictionary, and the code looks like it ought to work. However, when I run Valgrind on it, I get a number of read/write errors (mostly of size 4). In ...
0
votes
2answers
278 views

Valgrind errors at the end

I finally made my dicitionary.c work. It works all ok. But there are some errors at the end, when checking with valgrind, although it says no memory leaks. The error summary is: ERROR SUMMARY: ...
0
votes
1answer
552 views

Problem Set 5: Speller, Segmentation fault

I'm working through the "load" part of speller.c and running into problems... Here is a tiny snippet of my code to avoid breaking any rules: My hash_values are simple so A = 0, B = 1 C = 2 etc, and ...
1
vote
1answer
292 views

PSET5: Segmentation fault in load function

I get a segmentation fault whenever I run the program with the large dictionary, but not the small one, so I guess the error lies somewhere in load or unload but I can't localize it. The program also ...
0
votes
1answer
60 views

Initializing multiple variables inside a for loop

I have been working on the dictionary's "load" function in Problem Set 5, but I have a problem. I don't want to hard-code names for each node within my trie, which I am working on, but in order to ...
1
vote
1answer
36 views

spellchecker unload not freeing 1 block

What is not freeing!? [code snipped by mod] // end of load function (mod comment) return true; fclose(dict_file); } [code snipped by mod]
0
votes
0answers
325 views

PSET5 Speller: trouble with mispellings and tolower()

I am very close to getting my dictionary to word correctly, but I am having a small hiccup in my check function. In order to compare the word given in the check function to the dictionary, I first ...
0
votes
1answer
264 views

Pset5 dictionary.c is not producing correct output

I've implemented my load and check functions using tries. The program works fine and produces the output, but when I compared it against the output from staff's implementation, I found out that there ...
0
votes
1answer
194 views

2014 pset5: Double free in load

I can't seem to figure out how to allocate and free memory correctly when I'm using a linked list node (a pointer inside a struct). When I can get my code to run without error I am getting major ...
0
votes
1answer
228 views

Segmentation Fault in pset5

As part of the edX course, CS50, I'm trying to load all the dictionary information into an array of char pointers. This would give random access and therefore a pretty fast load and unload time. The ...
1
vote
1answer
483 views

how to compile dictionary.c? [duplicate]

I'm having trouble figuring out the problem with my load function. here's the weird error I get (I've never seen something like it): jharvard@appliance (~/Dropbox/pset5): make dictionary clang -ggdb3 ...
0
votes
1answer
168 views

Trie Spellchecker unload() - two allocs not freeing

My freeNode() function goes through each child of my root node and free()'s each of them from the bottom back up to the root. Two of the allocs are not being free()'d. #include <stdbool.h> #...
0
votes
1answer
921 views

pset5 dictionary: Misspellings differ when different hash functions used

I've been trying to figure this out and I really need help. When I run speller with a text file against the large dictionary, my code doesn't catch all the misspellings that are supposed to be in the ...
0
votes
1answer
711 views

Pset 5 Dictionary Loading

Here is my dictionary loading code, however the code keeps falling and giving me a bunch of numbers and "mallocing aborted core dump" Can someone help please?
0
votes
1answer
1k views

Why won't speller load large dictionary in pset5?

In pset5, Speller won't load the large dictionary. Per the pset instructions, I seem not to have implemented my dictionary.c properly. Below are the beginning of my dictionary.c load section, and ...
0
votes
1answer
31 views

Data compression: dictionary encoding

I am reading Computer Science: An Overview Eleventh Edition By J. Glenn Brookshear I believe this book was once assigned as optional reading material for CS50x A typical dictionary in a word ...
0
votes
1answer
533 views

Can I test implementation of load function in pset5 prior to completing check, size and unload

I have finished coding the load function for pset5 dictionary.c and want to see if it works (and confirm I am on the right track) before I go onto the other functions. I tried to execute speller.c but ...
0
votes
0answers
121 views

Can some help me understand why check isn't working

Here is what I have come up with. I am looking for maybe some guidance as to what is going on so I might fix it. Here the section in question. It never evaluates to true. if(current_Node-> ...
0
votes
1answer
54 views

losing node in the span of a few lines

#define NUM_NODES 27 int wordCount = 0; typedef struct trie { bool is_Word; struct trie* chilluns[27]; } trie; trie* current_Node; trie* root; /** * Loads dictionary into memory. Returns true if ...
1
vote
0answers
398 views

Hacker2 dictionary for crack

I want to write a program crack.c for hacker2, but I can't find a dictionary for it. In the task it is recommended to check /usr/share/dict/words, but there is no such directory in my application.
0
votes
1answer
138 views

Speller Dictionary: Problem with Pointers

I am a bit confused by all the new things about pointers. We can access a the value of a pointer by dereferencing it. For example, if you have char* str, you access the information that str is ...
0
votes
0answers
104 views

a simple linked-list try

First of all, i need to say that i am just trying to check my code working or not. For the following code, i used a so-called small dictionary which only includes the words "caterpillar" and "cat". ...
0
votes
1answer
582 views

how do I malloc nodes for use in a trie data structure

How do I use malloc to allocate memory for use in a trie data structure given: typedef struct node { bool in_word; struct node* children[27]; } LETTERNODE; What is the syntax for malloc in ...
0
votes
0answers
64 views

compiling errors

I'm dealing with pset5 (speller.c), and I chose trie to run the program. when I compiled it, it said: dictionary.c:25:1: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] root ...
1
vote
2answers
3k views

Try to use trie in pset5

I know if I want to use trie in pset5 to load the dictionary, there should be a struct containing an array of pointers for the alphabets or the apostrophe and a variable of bool. The question is, ...
1
vote
1answer
574 views

CS50x 2015 pset5 check50 & submission problem

SITUATION I enrolled in CS50x in late 2014. The class ended on 12/31/2014 and I was not able to finish in time. Enrolled in CS50x3 in 2015 and re-submitting my completed work where appropriate. ...
0
votes
2answers
1k views

Could not load dictionary in cs50 pset6

I have written the load code for pset6 which compiles but when I execute speller.c it returns "Could not load dictionary". I have tried using a homemade dictionary on my machine and the dictionary at ...
0
votes
0answers
248 views

pset6 check function - student result set doesnt match staff - works on small test, fails on big

I have a version of dictionary.c that has all of the functions completed and compiling. When I run ./speller on my small test sets it completes succesfully. When I run it using the following test, ...
0
votes
1answer
397 views

Implementing unload() in pset6 for trie

I've been struggling with freeing the nodes in pset6 for the past week. All other functions are completely ok. This is my implementation of node: typedef struct node { bool is_word; struct ...
1
vote
1answer
198 views

Where are the files from the “/home/cs50/pset6/dictionaries/” directory of the appliance?

I am doing the psets outside of the appliance, so I don't have access to the dictionary files and texts file for PSET "misspelling". Are these files distributed on their own somewhere?
1
vote
0answers
106 views

Is hash table a type of dictionary?

In week 7 shorts for trie it is said that "a dictionary is a type of data structure that maps a key (usually string) to value". So is hash table considered a dictionary too?

1 2
3