Questions tagged [dictionary]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
238 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
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
340 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
11 views

Pset 5 Speller: Could not load small

I don´t know what may be happening with my code. When I run it without any dictionaries it runs (although is also not able to open cat.txt), but when I try to run it using small it could not load it. /...
0
votes
1answer
23 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 ...
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
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
30 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
38 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....
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@...
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
46 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
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
24 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 ...
1
vote
2answers
34 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 ...
0
votes
1answer
47 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
62 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 ...
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
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
37 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
33 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
1answer
42 views

PSET5 Speller everything works but then I catch all the words as misspelled

Basically when I run the test with texts/lalaland.txt and compare to the staff's key, they have something like 955 misspelled words and I have all but 5 misspelled. I tried to but a "tolower"...
0
votes
1answer
38 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
0answers
35 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 ...
1
vote
0answers
43 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, ...
0
votes
1answer
69 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
0answers
92 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
40 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
35 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
1answer
41 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
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
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
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
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 ...
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. ...
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
80 views

Check50 issues, Pset 4, Speller

My code finally works, and I believe it is operating correctly but check50 says otherwise. Anyone see any blatant issues in my code that you can point out? // Implements a dictionary's functionality ...
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 ...
0
votes
1answer
159 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
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
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
458 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
234 views

scramble lookup function

I'm having a lot of difficulties with this problem since there are lots of concepts that I don't know. I'm trying to treat dictionary as an array of strings as below: bool lookup(string s) { int min =...
0
votes
1answer
130 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
220 views

Speller is not giving expected out

I have been trying to implement and re-implement speller but so far, I haven't been so lucky. This is what I get for a custom smaller dictionary and a text file: MISSPELLED WORDS nice WORDS ...
0
votes
1answer
268 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
96 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) { //...