I'm looking for a way to access iOS dictionary programmatically. What I need is to retrieve the list of the words of a particular language from inside a custom app.
Is it possible? Are there any API that provide this (or similar) functionality?
I've checked Apple documentation but didn't find anything useful...May someone point me to the right direction?
Join them; it only takes a minute:
|
|
|||
|
I don't think there is a public API to access the embedded Dictionary. The closest is using UITextChecker but that may not satisfy your needs As an alternative, you could find and embed a Word Dictionary in the Language you want? It may require some extra work |
|||||||||
|
|
There is an API for bringing up the built-in dictionary UI (not the original question but raised in some of the responses), including checking for whether a given word is defined:
|
||||
|
|
|
There is no API, but if all you need is a list of words you can read it from
If you need an arbitrary list of words you can get it from several online resources, here is one. The README at /usr/share/dict/README says iOS word list uses ftp://ftp.ox.ac.uk/pub/wordlists For instant search you'll need to load the words on a structure suitable for prefix search, like a trie. Here is a sample project where I did just that. If you need a dictionary, get one online, then include a pointer to the word entry in the trie node. If loading takes too much time you can experiment loading on the background, or compressing, or serializing the trie. |
||||
|
There is no API to do what you are asking. |
|||
|
|
|
I ran into a similar problem a long time ago and did what other people suggested: embedded an English dictionary inside my app. Since then I've turned my solution into a static library which is available at www.lexicontext.com (note that it costs a few bucks). Considering the number of developers who downloaded it, this seems to be a common problem... |
|||||||||||||||||||||
|
|
Even there is no API, it can be used automatically if user long-press the selected word. |
|||
|
|
|
If you can use the private API you can use the following code to define a word:
|
|||
|
|
NSDictionary. – Adam Rosenfield Sep 14 '11 at 17:03