Questions tagged [check]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
47 views

pset5 Can we remove duplicate words from text?

In pset5, we are trying to minimise the time taken to check for misspelled words. Therefore, I'm thinking it would be a good plan to remove duplicate words from the file text, before checking to see ...
0
votes
1answer
616 views

Pset5 - Load and check fault

this is my first ask. I ever looked up all the answers and managed well alone but i am really stuck now. So, i am doing the load and check functions of dictionary. I did a test program with all what ...
0
votes
1answer
274 views

Last try, Pset 5 load, check

I'v spent days trying to fix this, with one bug after the other and still havent been able to solve it. I'd be grateful if anyone can tell me what I'm doing wrong. Some stuff I found out :- 1) At ...
0
votes
0answers
40 views

Strcopy pset5 segfault

I get this seg fault in the strcpy line when I debug with gdb. int wordlen = strlen(word)+1; char worda[wordlen]; strcpy(worda,word); I tried with char* but even then it wasnt working. Full code ...
0
votes
2answers
584 views

Pset5 check function, and probably load

Ok...I'm doing pset5 and I'v already done the load function though I think there's something wrong with it.When I run speller it gives a seg fault in check function.Something to do with strcmp ...
0
votes
1answer
246 views

Problems with letters “a” and “I” misspellings

My program loads and checks correctly with small texts and the large dictionary. Although when I load large texts, for some reason calls misspelled for the letters "a" and 'I'. I'm struggling with ...
1
vote
1answer
263 views

pset5 - possessives and substrings

I have posted this questions a few days ago, but none of us were getting anywhere. I thought maybe including my code for load as well as check might yield some new revelations. Anyway, here is the ...
0
votes
2answers
243 views

pset5 - check - possessives and substrings

I have all the memory leaks taken care of. Valgrind is showing no errors. My trie structure seems to work fine. The last part I need to do before I claim victory on this pset is to figure out exactly ...
0
votes
1answer
1k views

CS50 dictionary.c problem with hashtable

Im having troubles with the hashtable in pset5, in the part where you check wether a word is in the dictionary. My code looks as follows: bool check(const char* word) { int n = strlen(word); ...
0
votes
1answer
305 views

using root and current nodes in check when not declared until load

So i have used a trie structure for this pset. And i have declared my struct node in the load section as well as root and current which are nodes. I've written my code for check but I need to access ...
0
votes
1answer
212 views

Can't free malloc used in check

My pset5 speller is complete works with all check 50. Hell it's even faster then the staff's speller. BUT valgrind is not happy. I am unable to free malloc function used in check. if i do it before ...
0
votes
1answer
403 views

pset5: problem with check function

I'm stuck on the check function of pset5 .. when I run check50, I get all happy smiley faces except for... :( handles substrings properly :( handles most basic words properly The load function ...
0
votes
1answer
424 views

Why does check find so many misspellings?

I used the following functions in speller, but, when I ran the program with the Constitution as text it gave me something like 6900 misspellings out of 7500 words. I don't understand it since I made ...
0
votes
1answer
246 views

dictionary.c spell checker not working correctly

I have spent a lot of time trying to fix my check() function but I can't figure out where it is going wrong. By using printf(), it seems that the passed in word sometimes does not match with the word ...
1
vote
1answer
132 views

Check function skipping the check and returning all words as misspelled

Hello my check function keeps returning false for all of the words. I ran it through gdb: Some prints i did in gdb print thisNode (node *) 0x804c170 print thisNode->word $2 = "elephant\n", '\000' ...
0
votes
1answer
44 views

Segmentation fault in check functon

I am getting a segmentation fault in a while loop for my check function. I don't know why it is happening and need some help understanding my error. This is my function: bool check(const char* word) ...
0
votes
1answer
503 views

pset5 speller, check function returns all words as false

I've been tearing my hair out over this problem for three days now, and just can;t find where I'm going wrong. All seems okay with this program, it loads the dictionary file (using a trie), gets the ...
0
votes
1answer
245 views

Caesar checking help please

So i just started caesar, and I think the checking for argc being 2 is pretty easy so i wrote: int main(int argc, string argv[])[ if(argc < 2 || argc > 2){ return 1; } else if( argc == 2){ ...
0
votes
0answers
124 views

Problem in recover in pset4

I have done my recover program and I get the 16 jpg images. They are well named and I can see them so the program is working correctly but when I check the program I get an error in the set recovers ...
2
votes
1answer
120 views

How do I make dictionary.c compile with strings.h?

There seems to be a useful function -- strcasecmp -- in the strings.h library (notably different from string.h). However, when I try to amend this to my header information (e.g., #include <strings....
0
votes
3answers
343 views

I can't check sort in Helpers.c

After reading the other questions, I still don't get how to check it. I tried to use gdb on ./find, but while I ran it, I could only see what was expected. Then, while typing n, it said "in fileops.c"...
2
votes
1answer
266 views

Comparing jpg-signatures with fread-buffer; Can't find something

Using the if condition I am trying to compare the buffer with the given jpg signatures, but I never find something. In GDB I just see the while looping, but never entering the if condition. What have ...
0
votes
1answer
582 views

Why doesn't my program handle sub-strings properly?

I have tried figuring out what the problem is with my code, but I can't find any. What could be my problem? check50 2014.fall.pset5.speller dictionary.c dictionary.h Makefile :) dictionary.c, ...
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 ...
0
votes
1answer
107 views

why check50 is not evaluating corectly for my question

I have tried to approach the question in move simplifir=ed way and i have created an array and declared it globally. my programme is correctly responding to all the asked questions but still I'm not ...
0
votes
1answer
126 views

Why check50 is not evaluating true when my programme is corectly responding to all the asked questions?

When i run check50 it shows everything in red and when i open the given link it shows the below image. I have removed the printf commands also but still then it is showing the same problem. someone ...
-1
votes
2answers
69 views

Initializing struct globally in pset6: trouble with persistent values of root

I'm implementing a trie for pset6. load works properly as far as I can tell. (gdb, valgrind both fine with it, and the #of words loaded comes out right as well). check, however, generates a ...
0
votes
0answers
249 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, ...
-1
votes
1answer
293 views

Problem with Handles most basic words properly

When I try to check my pset6 I don't pass two of them https://sandbox.cs50.net/checks/5e81cae19025464a9a188d512fe92923 I think that my problem is in the check function, but I don't understand why ...
-1
votes
1answer
423 views

Different methods for transforming a string to lower case in C

In the check() function I've figured that I should transform the input word to all lower case. To do that I wrote this: int wlen = strlen(word); char word1[wlen+1]; //transform the word to all ...
1
vote
1answer
207 views

Return value of load()

I just finished implementing load() in problem set 6. However there is still one thing I'm still not sure about: When I finish loading the dictionary file, should I return True or return the actual ...
0
votes
0answers
201 views

check() doesn't work properly

check produces wrong output I have tried gdb on the first words and everything seemed right. here is some psuedocode. // while in hashtable // if the word is found return true // if we reach ...
0
votes
1answer
325 views

pset 5 Recover check if file open

How do I check if I already opened a jpeg file to write to? I could declare an int outside of the loop that I set to 1 if I open a file, but I think there must be another way... Some kind of function ...
0
votes
1answer
227 views

Infinite loop in speller.c check function

I can't seem to break out of this infinite loop here is my pseudo code: malloc cursor malloc new_node for(length of word) { if(letter is uppercase) { make letter uppercase } } copy string ...
0
votes
1answer
227 views

Segfault Pset6 Check()

I receive a segfault at this line of code if (pathCheck -> children[charVal] == NULL) { return false; } pseudocode buildup: initialise pathCheck to NULL while character is ...
0
votes
1answer
461 views

How to pass a pointer to the root node to check(), size() and unload() in speller.c?

For speller.c, you can't pass a pointer to the root node (I'm using a trie) to check(), size(), and unload(). And I couldn't create a global root node in dictionary.c error: initializer element is ...

1 2 3
4