Questions tagged [dictionary]

The tag has no usage guidance.

37 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
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
1answer
25 views

pset5 speller “Could not load dictionaries/large” error

#include <ctype.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include "dictionary.h" #define ...
0
votes
0answers
32 views

CS50 Speller valgrind issues and

I'm new to CS and could really use some help on the speller pset. I've got a basic outline that doesn't seem to seg fault, but I'm still having issues. It fails check50 in that: it doesn't handle ...
0
votes
1answer
51 views

pset5 valgrind tests failed

I'm very close to completing pset5; all smiley faces except the Valgrind memory leak. I'm hoping someone can help find the problem. I am only leaking 112 bytes and have tried to fix the issue by ...
0
votes
1answer
40 views

PSET 5 My hash table doesn't seem to be storing correctly

When I load the dictionary, I add the words to the hash table, by calling the hash function to calculate the bucket ID, then add hash function to actually insert it into the list. Inside the addhash ...
0
votes
2answers
35 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
41 views

check50 keeps printing “Could not load basic/dict.” what might be the problem in the code?

// Implements a dictionary's functionality include include include include "dictionary.h" include include include // Number of buckets in hash table define N 120000 //maximum length of ...
0
votes
0answers
98 views

solved pset6 BUT still wondering

while reading the CSV file in these lines : csv_file = open(sys.argv[1], "r") # reading the csv file into memoery csv_reader = csv.DictReader(csv_file) when i tried to make a copy of the csv_reader ...
0
votes
1answer
37 views

I am having a segmentation fault before my main code runs, but code will compile. pset 5 - speller

// Implements a dictionary's functionality #include "dictionary.h" // Represents a node in a hash table typedef struct node { char word[LENGTH + 1]; struct node *next; } node; // Number of ...
0
votes
0answers
38 views

Dictionary load in pset4 -> Trie Implementation

I don't know if this is a problem others have had? Having some issues with the dictionary load function in pset4. I decided to implement a trie and thru following debug50, I can see that it is ...
0
votes
0answers
30 views

I keep getting seg faults when running code

I've been looking through my code, but I'm unable to figure out why my code keeps seg faulting. I used my own custom hash function to take the first character of each string in the dictionary to 26 ...
0
votes
1answer
40 views

Pset5 Speller dictionary entries getting overwritten

I'm having problems with pset5 speller where the words I load into my dictionary hash table are getting overwritten. So for example if I load "Ashley", "Britney" and "Charlie" into my dictionary, all ...
0
votes
1answer
252 views

PSET 5 Spell Checker - Error: Could not load dictionaries/large

I would be so grateful to anyone who can help me figure out this issue. After finally getting my code to compile I was met with the following terminal error when attempting to run the program: "...
0
votes
2answers
64 views

PSET5 Speller Trie Errors

So far, all other methods except check have already been implemented properly in my code. The problem with check is that it only returns true a lot fewer times than expected, which means that most ...
0
votes
1answer
43 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
41 views

Last word of dictionary file replaces all the nodes in node bucket

Currently I am working on the load function using a hash table with singly-linked list. I have tested the create(), insert(), and find() function in a separate file and they work as expected. ...
0
votes
1answer
108 views

Pset 5 Dictionary TRIE Segfault

I know posting the while code is not cool, but I frankly can't figure out what is wrong anymore. I should have done this with something easier than trie-structure, but since it is close to done I'd ...
0
votes
1answer
93 views

Speller thoroughly modified yet still fails tests pset5

I have put many controls into the code, simplified the hash function, used gdb extensively, all which suggest the code works yet it still fails the tests, especially words like Still, Home, Video, ...
0
votes
1answer
341 views

dictionary check50 returns \ expected output, not standard error of “/opt/sandbox50/bin/run.sh: line 31: 102…”

My dictionary implementation appears to work as my program's output matches the staff exactly. Check50 is giving me the error below for every check starting with handles most basic words \ ...
0
votes
1answer
601 views

pset 5 dictionary problems

I am having problems with pset 5. Honestly so far I have never had such a huge problems with a pset. I watched every video, read many questions and answers on stack exchange and wrote some code, which ...
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
0answers
334 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
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
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
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
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 ...
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
116 views

PSET5 - Loads 0 words into dictionary

my code compiles and runs, but loads 0 words into the dictionary. Can you spot what's wrong with it? (As a sample, I tried using the smaller dictionary with a random text file. example syntax: "./...
0
votes
1answer
964 views

Valgrind still reachable memory

For my pset5 speller program valgrind is saying that i have still reachable memory. This is the output: HEAP SUMMARY: ==24516== in use at exit: 352 bytes in 1 blocks ==24516== total heap usage: ...