I'd like to search for words in the OS X system dictionary (or dictionaries) using a simple glob or regex rather than a known text. (Currently I'm using /usr/share/dict/words
instead, but the OSX dict would be a lot nicer.)
The Dictionary Services interface is quite limited and doesn't allow this, but it seems like DSGetTermRangeInString
might be doing something similar under the hood. Does anyone know of a way to access such functionality?
Alternatively, is there a way to extract a word list from the dictionary? I could then grep that. Some dictionaries seem to include the source XML in the bundle, which should be easy enough to parse, but (not surprisingly, I guess) the big language dictionaries only have the data in some binary format. Any clues as to what that might be?