开发者

Searching the Mac OSX system dictionaries?

开发者 https://www.devze.com 2022-12-11 07:59 出处:网络
I\'d like to search for words in the OS X system dictionary (or dictionaries) using a simple glob 开发者_StackOverflow中文版or regex rather than a known text. (Currently I\'m using /usr/share/dict/wor

I'd like to search for words in the OS X system dictionary (or dictionaries) using a simple glob 开发者_StackOverflow中文版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?


The dictionary Apple provides in OS X is licensed from one of the major publishers. Legally, they can't let you dump the whole word list.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号