views:

92

answers:

1

Hi all,I want to develop an iphone application that needs an english word dictionary. Can you people suggest me any link from where i can have that database containing a reasonable number of english words with their meanings and example sentence.

Thanks in advance

+1  A: 

Update

I recently found out about a much more useful API than wiktionary. It seems google has a "Google Dictionary" that you can use, though it's an unofficial API. Using this query:

http://www.google.com/dictionary/json?callback=dict_api.callbacks.id100&q={query}&sl=en&tl=en&restrict=pr%2Cde&client=te

You can get a JSON result from google dictionary. Substitute your keyword for {query} (eg q=dog). Apparently this is the dictionary that google docs uses, and possibly some chrome extensions.

Source: Google Operating System (blog)

PS: The comments also mention an API for Dictionary.com.

Previous response

You could access Wikitionary's data via Mediawiki's API. That might be enough for what you need. I don't know of any pre-made dictionaries you could use. If you need spell checking, you might be able to get Aspell working on iPhone.

Links:

There may also be wrappers for the API already created in the language you need. Some are listed on this page.

If that doesn't do it for you, you could try scraping one of the other dictionary websites too.

Edit

I'd probably only try this as a last resort because (as far as I know) you can't get any easily usable results from querying wikitionary. You can get the wiki code for an entry, though. The problem with that is that you'll then have to somehow extract the important information from that code.

For example, take the following query (click to open in your browser):

http://en.wiktionary.org/w/api.php?action=query&titles=dog&prop=revisions&rvprop=content&format=xml

If you read the documentation, you'll see the parts here are action=query, titles=dog, prop=revisions, rvprop=content, and format=xml. These tell the api what you want. It says "I'm performing a query for the entry with title 'dog' and I want the content of the latest revision in xml format".

What you get is:

<api>
  <query>
    <pages>
     <page pageid="24" ns="0" title="dog">
       <revisions>
         <rev xml:space="preserve">
{{also|DOG|dög}}
==English==
{{wikipedia}}
[[Image:YellowLabradorLooking.jpg|thumb|A dog (a [[Labrador]])]]
... (removed for brevity)
          </rev>
        </revisions>
      </page>
    </pages>
  </query>
</api>

You'll have to process that somehow.

Anyway, you can create the http request strings yourself, or you can use a wrapper for the api that does the "hard" work of making queries.

Benny Jobigan
Thanks for that reply.But can you be little more descriptive about the solution. Actually I understood very little from those links.I need your help to get me going.Thanks agin..
Joy
I added some more info to help explain.
Benny Jobigan
Thanks a lot..Thatwas really helpful.Bye.
Joy