Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Searchable Dictionaries (Not online)

Searchable Dictionaries (Not online)
Thread Tools
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 18, 2001, 11:44 AM
 
First of all, let me express my hate for IE deleting info in text fields when u hit the back button. Now to the rest of my post:

I need a searchable database of English words so I can check a bunch of combinations of letters to see if they are English words. I don't need definitions or pronunciations, etc, just that the word exists in the English language. I'd prefer to have a local copy, as I have a modem and lots of calls to dict.org may take a while. Just one giant text file with all the words in the English language would be fine.

Thanks,
F-bacher
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 18, 2001, 12:01 PM
 
I don't have X open, but 'word' is aliased to do a grep search through a local dictionary (so, e.g., 'word tri' returns triangle, and all other words including the substring or regular expression 'tri'. Just check the alias and it will give the path to the dictionary. Don't know if it includes plurals, etc.
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 18, 2001, 12:41 PM
 
That looks like a good idea, the word command, but it doesn't have a man page. I'd really like to just have the command "word x" tell me if x is a word, not if its part of another word.

Any other ideas?
F-bacher
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 18, 2001, 12:42 PM
 
DOH! I just realiaized word is an alias... no wonder there's no man page.

F-bacher
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
May 18, 2001, 03:56 PM
 
Most Unices have just the sort of thing you're looking for, buried somewhere or other in the system. While it doesn't have all the words in the English language, it should be enough to get the job done, as it has all 234,936 words from the 1934 edition of Webster's Second International Edition.

Check it out in /usr/share/dict if you're interested.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Junior Member
Join Date: Oct 2000
Status: Offline
Reply With Quote
May 18, 2001, 04:05 PM
 
I have a couple ASCii word lists that you could cat together and use with the 'word' alias mentioned above.. You can grab them here.

Another option would be a simple app that passes a word to Apple's spell checker and returns a thumbs up or a suggests words of a similar form.. Search the 1MB worth of ASCii text words above is farily quick, but searching the 260kB binary dictionary file should be a bit quicker..

Hope this helped..
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 18, 2001, 07:07 PM
 
Okay, greping the text files is going well... except I'm not sure how to tell my cocoa program where the dictionary files are. That is, the files I use are stored in Myapp.app/Current/Resources/. That's all good, except that the working directory as soon as I launch Myapp.app is /. And since I can change the location of my app, and even the name of my app, I'd prefer not to hardcode in the full path /Applications/Myapp.app/Contents/Resources/. So... and ideas? Note: I can translate some obj-C to Java, but explanations in Java are perfered.

Thanks,
F-bacher
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status: Offline
Reply With Quote
May 19, 2001, 01:20 AM
 

NSBundle.mainBundle().bundlePath() returns the path to the .app.

NSBundle.mainBundle().pathForResource("dict", "txt") will return path to the file "dict.txt" inside the application's Resources directory. It also handles localization and app-wrapper layout details correctly. Always use the NSBundle method pathForResource() (or one of the variants) to find files inside the application wrapper.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:11 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2