PDA

View Full Version : Adding to NSMutable Dictionary




Blakeasd
Apr 15, 2011, 10:58 PM
Is it possible to add all of the terms (not the definitions, just the name of the work) from the built-in OS X Dictionary into an NSMutableDictionary?



gnasher729
Apr 16, 2011, 02:36 AM
Is it possible to add all of the terms (not the definitions, just the name of the work) from the built-in OS X Dictionary into an NSMutableDictionary?

I wish you lots of luck doing this, but there seems to be no useful documentation about it at all. If you figure it out, I would be very grateful if you posted here how to do it.

robbieduncan
Apr 16, 2011, 02:46 AM
Dictionaries are in /Library/Dictionaries/

Each Dictionary is a bundle (with a .dictionary extension). Within each dictionary bundle in the resources is a (localised) xml file called <DictionaryName>.xml. You can parse the xml (the format looks quite simple) to get all the keys (and definitions if you want).