Questions tagged [dictionary]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
100 views

Unknown problem with dictionary.c Help!

dictionary.c doesn't compile, but i am not getting the usual error when I try to compile it. Instead I get something I haven't seen before and I have no clue what it is trying to tell me. Does anyone ...
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
2answers
274 views

Problem in my unload function (double free or corruption)

so I have been straggling pset5 for some time and I end up getting double free or corruptionand don't now how to fix it. Here's my code : /* inside load() */ // some code if(head->children[b] == ...
1
vote
1answer
60 views

Speller.c finds some words, but says that correct words are mispelled PSET 5 - Speller

After finishing writing my functions in dictionary.c, I have tried testing it out using austinpowers.txt, but the output is blatantly incorrect. (As seen in pastebin, 6259 words are incorrect.) Some ...
1
vote
1answer
51 views

pset5 trie: What is the boolean-data value in the root node if the dictionary has one-letter words?

I think I understand how the children-nodes of a trie are supposed to work. But if the dictionary contains one-letter words like "a" and "I", what should the boolean-data value of the root node be? If ...
1
vote
1answer
121 views

Memory leakage PSET 5

I've successfully implemented the dictionary and it fully works. When I run valgrind I get 2 nodes (224 bytes each) that are leaking. I really don't know how to fix this. Can someone help? ==1316== ...
1
vote
1answer
99 views

PSET5 Question about pointers

I had a question for dictionary.c. First, I'm still confused at why load and check imput is const char*. I understand that const char* means that the value that char* points to will never change and ...
1
vote
2answers
607 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 ...
1
vote
1answer
293 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 ...
1
vote
1answer
489 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 ...
1
vote
1answer
576 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. ...
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
2answers
36 views

Pset5: check unable to find words

Thankfully, I don't get any seg faults so I'm guessing unload() is working properly. Also, load() seems to run correctly when debugging, so I'm guessing the problem isn't on loading either. I don't ...
1
vote
0answers
52 views

PSET6: dna.py, updating dictionary

I'm struggling with Python, specifically adding/updating keys and values in a dictionary. This is my code so far (I know it's probably far from perfect, this is my first time working with Python, ...
1
vote
0answers
31 views

dictionary hints?

I just submitted my dictionary code to the Big Board. My results weren't horrific (well, I did use more memory than anyone else, lol); but I'm a little disheartened when comparing to the best results. ...
1
vote
0answers
61 views

CS50, pset2, crack, suggested dictionary file

I am taking cs50 on edx and I am currently on pset2, crack. I want to find a dictionary file that has a fair (maybe over 50,000?) amount of words in it to encrypt and compare them with the hashed ...
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 ...
1
vote
1answer
223 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 ...
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]
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.
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?
0
votes
2answers
793 views

(pset5) valgrind - 1 block not freed

I've grinding away at this one problem for a couple of days now, and can't quite work out what's going wrong. My code passes check50. The output is fine. I'm relatively happy with how quickly it runs. ...
0
votes
2answers
160 views

Pset5 - Valgrind causes 9544106 errors, Uninitialised value was created by a heap allocation

Im unsure if there is any error in my recursion in unloading/unload to free all memory. (But i doubt so because help50 tells me all my memory were freed- 367,084 allocs, 367,084 frees) I checked ...
0
votes
1answer
696 views

pset5 speller Invalid write of size 1

my implementation of dictionary.c passes all checks using check50 except memory leaks. I'm using valgrind and most of my leaks seem to be happening in my check function: // Returns true if word is ...
0
votes
1answer
78 views

too many misspelled words

I'm working on my spell checker, and everything seems to be compiling. However, when I run the spell checker, the number of words that it finds that are misspelled is way high. I'm not exactly sure ...
0
votes
2answers
285 views

Pset5, load skips first letters and the last word; Dictionary isn't loaded

I've used a dictionary I created and it's got 8 words. However, speller doesn't recognize the last one (it counts 7), but also it returns two words misspelled, even though all of them begin with ...
0
votes
1answer
561 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 ...
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 ...
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 ...
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
583 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
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
1answer
47 views

I dont understand valgrind pset5

Error from valgrind $ valgrind ./speller texts/cat.txt ==1453== Memcheck, a memory error detector ==1453== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==1453== Using Valgrind-3.13....
0
votes
1answer
72 views

Finance index function does not return lookup value in index.html

I'm trying to render my lookup values inside of my index function implementation, but I cannot get these values to render in my index.html page. I added share = lookup(record['share_symbol']) to grab ...
0
votes
1answer
26 views

Finance index.html is not rendering values from my index function

I'm having some issues trying to render values on my index.html page. In my index function, I created a dictionary of values from my transactions table to grab each record of my share symbols, share ...
0
votes
1answer
63 views

Please help! I'm stuck on Pset5 Speller!

#include <stdbool.h> #include <stdlib.h> #include "dictionary.h" #include <string.h> #include <stdio.h> #include <ctype.h> int wordCount = 0; // Represents a ...
0
votes
1answer
75 views

pset5 speller “Could not load dictionaries/large”

I cannot figure out what I am missing. Program keeps returning "Could not load dictionaries/large" I have checked and tried different suggestions from similar questions but I do have the folder ...
0
votes
1answer
52 views

CHECK50 ERRORS IN SPELLER PSET

Here is my code for the pset I am getting 2 errors after check50. I am not able to get hold of any loopholes in the code. Kindly help! 1) :( handles max length (45-char) words expected "MISSPELLED ...
0
votes
1answer
24 views

trie speller works on custom dict but misses mispellings on large dictionary

So my speller works fine with a custom dict, but not with the large dict. This is my code in dictionary.c (haven't modified other files): // Implements a dictionary's functionality #include <...
0
votes
1answer
19 views

Pset4 Speller (Hash table) word count only fails in check50

All of the "WORDS IN DICTIONARY: " parts are resulting in "0" but when i run the code on my computer trying both the "small" and "large" dictionary it seems to work perfectly. So what might be the ...
0
votes
1answer
24 views

dictionary.c trie: setting variable to NULL doesn't set element to NULL

Working on the unload function in speller (dictionary.c)... My current test dictionary simply contains a letter c, as I'm just trying to make sure one iteration will work. So I should (and do, ...
0
votes
1answer
173 views

Unload works on small dictionary, but not on large? (speller.c / hash table method)

When testing with the small dictionary, it unloads as expected however when testing with the large dictionary, I receive the error "Could not unload dictionaries/large." The only difference that I've ...
0
votes
1answer
195 views

2018 pset4 dictionary check() doesn't check dictionary

I'm in a pickle here. I have followed walkthrough step by step for this part. But my code just keeps on refusing to load dictionary. (Sorry for the low quality code here) bool load(const char *...
0
votes
1answer
76 views

Scramble.c lookup function found flag

So I've got the binary search function working for this problem, but I have no idea how to deal with the "found" flag portion of the problem. I think the idea is to add a "true" condition to the bool ...
0
votes
1answer
512 views

error: use of undeclared identifier 'word'

I've been having quite a few issues with Pset5 and I can't figure anything out. I've been playing around with the placement of 'char word[LENGTH+1]' but I always get an error: "use of undeclared ...
0
votes
1answer
146 views

dictionary.c not iterating through the linked list, if the hash exists it always returns true

Trying to figure out a bug in my dictionary.c code. Please bear with me as I try to explain the bug. I've been using the debugger, and it seems that anytime there is a collision in my hash table, ...
0
votes
1answer
276 views

Please help with Speller: all words return misspelled

I've combed through my code for this pset and reviewed the walkthroughs and shorts countless times and am now resigned to admit I need help. Thanks to Peter, I'm no longer leaking any memory (yay!), ...
0
votes
1answer
101 views

Problem in unload

I am having problem in my unload. While running valgrind it shows no leaks, but the program wont acquiesce check50. Here is the unload function: //free the memory bool freenode(node *first) { //...
0
votes
1answer
215 views

Segmentation Fault on Hashtable

PLease Someone help me I was trying to implement a hash table that stores the word of English language for pset 5. So to be in brief, I used an array of linked list ( Chaining ) , I haven't made the ...