Questions tagged [dictionary]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
18 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
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
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 ...
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 ...
0
votes
1answer
44 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
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 ...
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, ...
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
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
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
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
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
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
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
85 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
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
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
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
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
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
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
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
95 views

pset5 speller dictionary errors

Can someone give me feedback on my code please? I can't compile this, and it says too many errors. A lot of the errors don't seem to make sense. For example, it says "error: use of undeclared ...
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
621 views

Need help with check in speller (trie)

Stuck on speller, especially check, but load has some problems too. I am using a trie, but I kind of regret choosing it, because it has been very tough. I believe my problem is with the use of *next ...
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
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
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 ...
0
votes
1answer
235 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
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
75 views

PSET5: load fails with large dictionary, but works with small dictionary - trie

I'm trying to use a trie structure to implement the load function in speller. I get a segmentation fault with the large dictionary, but not the small one. Text file size does not seem to matter, (I ...
0
votes
1answer
45 views

PSET5 speller: all words listed as mispelled and check50 gives substrings a sad face

I made my dictionary.c for my speller program, however... it lists the whole text as mispelled check50 gives a sad face for substrings, showing that in its testing, "cat" is listed as mispelled, ...
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
1answer
95 views

Pset5 Speller Tries Valgring memory leak; don't undertand how unload works

The code works and I compared it with the staff's code it cought all the errors but it leaks memory. I don't know why isn't it freeing new_node. I also managed to make unload() work but I don't fully ...
0
votes
1answer
105 views

Stuck on the unload() function. Possibly wrong logic used on load() and check() using tries

I am using tries to complete the spellcheck but I just can't keep up with the logic. I've implemented load() and check() as much as I could but I'm sure it has some logic flaw. The unload() function ...
0
votes
1answer
25 views

dictionary - need some hints to target details why it doesn't work - please

So my code does compiles but it does print all the words as mispelled plus now i have a segmentation fault. Please i need so hints. here my codes : https://pastebin.com/4axfif3g