Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Good digital dictionary?

Name: Anonymous 2012-07-22 10:09

I need a good dictionary for checking whether or not a given string is an English word or not. Do I need to approach this problem a certain way? I'll be needing to scan a lot of words, so I'm prioritizing quick lookup time.

If it matters, I'm working in Java. Suggestions?

Name: Anonymous 2012-07-22 10:13

/usr/share/dict/words

Name: Anonymous 2012-07-22 10:18

Unfortunately I'm also on a windows box.

Name: Anonymous 2012-07-22 10:19

I'm prioritizing quick
I'm working in Java

Name: >>4 2012-07-22 10:20

But in all seriousness, copy out /usr/share/dict/words to your Windows box and go from there?

Name: Anonymous 2012-07-22 10:27

>>4 Very funny. Seriously.
>>5 I suppose that will work? It's just newline delimited, which seems like what I want. Will searching that be efficient if I'm checking every word in a text file?

Name: Anonymous 2012-07-22 10:30

>>6
With grep, it's not that hard. Not sure what the Windows equivalent would be.

Name: Anonymous 2012-07-22 10:33

>>7 Thanks, I think I got what I needed enough to move on.
If you're curious, I'm analyzing text to determine ratio of incorrectly spelled words to correctly spelled ones.

Name: Anonymous 2012-07-22 10:35

>>7
Think of a nice utility: the Windows equivalent is there isn't any.

>>6
If you're doing this multiple times within the running time of program then it might help to keep them sorted in memory as an array and then just binary search on it. I mean, if you're using Java you can spare the mem overhead

Name: Anonymous 2012-07-22 10:49

>>9
The Windows equivalent is where.

Name: Anonymous 2012-07-22 11:05

>>9 I like this idea. Think I'll go with it.
>>10 How would I integrate the where command into my java program? Seems like that might get a bit clunky.

Name: Anonymous 2012-07-22 11:34

>>11
Don't do that, I was just answering to >>9 and hadn't read the thread.
Find an appropriate data structure for quick lookup in your dictionary. A Trie, for instance.

Name: Anonymous 2012-07-22 11:41

>>12 Would there even be a way to do that? Is there a way to call a system utility from a script? There must be, I've just never heard of it.

Name: Anonymous 2012-07-22 11:46

>>13
Yes, you could use the Runtime class.

Name: Anonymous 2012-07-22 12:11

>>14 That's great, I'm glad I know what it is now.
Thanks!

Name: Anonymous 2012-07-22 17:27

Name: Anonymous 2012-07-22 18:08

>>implying you can't download or recompile your own copy of grep

Name: Anonymous 2012-07-22 18:30

Name: Anonymous 2012-07-22 21:24

>>9
Loading the entire English language into memory? This is normal on Java.

Name: Anonymous 2012-07-22 22:13

>>16
だぜ☆

Name: Anonymous 2012-07-23 13:35

>>19 I know. Sad, but true. But it's what I'm working in.
Oh well.

>>16 That's awesome, will consider using it in the future for sure.

>>17
>>18 Why the FUCK have I never thought of this?

I'm a bit of a greenhorn. But I like to think I'm learning fast.
Bear with me /prog/, and thanks.

Name: Anonymous 2012-07-23 18:42

Check my dubs in your dubsionary

Name: Anonymous 2012-07-23 19:34

>>19

Very much so, as long as Notch's fat ego allows it

Don't change these.
Name: Email:
Entire Thread Thread List