aspose file tools*
The moose likes Beginning Java and the fly likes classic dictionary / hash table issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "classic dictionary / hash table issue" Watch "classic dictionary / hash table issue" New topic
Author

classic dictionary / hash table issue

f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
hey,
i have been staring at this for the last (2) hours and can't see where i'm going wrong. for the input (C) and C++ the file check comes back misspelled and i know "c"<yes "" because it's a String> is in the table. works fine other than that with the file he gave us. here is the code:




and ...




i know that a lot of the methods are superfluous, just experimenting with different io schemes. any help will be greatly appreciated. thanks.

nikita
[ April 17, 2008: Message edited by: f. nikita thomas ]

Imagination is more important than knowledge "Albert Einstein"
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39419
    
  28
So what is it supposed to do, what is supposed to be in the file you are reading?
f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
125000+ word dictionary which is then used to spell check another file. he had us hard code alot of stuff that i would have passed on the commandline but then he already makin' real bacon, so we dance to his tune ... if anyone wants the files, email me.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11419
    
  16

That's a lot of code for someone to wade through... especially when you admit "i know that a lot of the methods are superfluous". Can you whittle it down to the bare minimum needed to show the problem?

and i'm not even sure i understand the problem... you are spell checking a file, and the input has "(C)" in it. your checker say this is invalid, even though your dictionary has "c" in it. is that it?

can you change your input file to JUST have "(C)" in it and debug it with a lot of println() calls? does case matter? do the parens and ++ matter (in other words, pass in "c", "C", "(c" and "(C" and see how those work... maybe the characters after the word aren't being stripped.
[ April 17, 2008: Message edited by: Fred Rosenberger ]

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
give me a minute to "whittle" it down. yes fred, it is an infix issue.
f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
here is the code. i cut it down as much as i could ...



f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
modified the file, "C" and "c" got caught, "(C" and "(c" passed as expected. in all cases the punctuation was stripped. curious ...
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
So what is "in the file he gave us" and is the data file multibyte?

Sounds to me like this is intermediate, not beginner. There are some subtle issues that can be of consequence in the search for this. Is the parser you are writing all in Java or is there a cross-platform linkage that can be looked at for ideas? I slapped together the following, it may or may not be correct. My first thought was to check for hash collisions. I ran this and found nothing so my next short list issue to look at is what platform the testing and development is being done on along with what the data file looks like.


[ April 17, 2008: Message edited by: Nicholas Jordan ]

"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
I rarely use capital letters for a good reason. I feel that they convey a different meaning when used. That being said, I apologize for posting this topic since I didn't check my data file; if I had I would have found that the reason I got the output I received is due in part that the dictionary file didn't have single letters. Live and learn. Take care.

nikita
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classic dictionary / hash table issue