Skip to content

Dictionary Integration

oazabir edited this page Oct 8, 2012 · 1 revision

Introduction

When user hovers mouse on a word, whether Arabic or English, it will show a popup with the translation.

Implementation

Whenever mouse hovers on a word for one sec, show a small popup which will show the translation of the word.

Arabic Integration

This site has an API that we can use to get the meanings of an Arabic word: http://aratools.com/

Make an http post to this URL, using a server side http handler: http://aratools.com/dict-service The post contains a parameter named "query". query = {"dictionary":"AR-EN-WORD-DICTIONARY","word":"بِسْمِ ","dfilter":true}

It returns the html that you can show directly on the popup:

<table id='result'><th align='LEFT'>Form</th><th align='LEFT'>Gloss</th><th align='LEFT'>Pos</th><th align='LEFT'>Root</th><tr class='dict-table-even-row'><td class='arabic-text'>??????</td><td align='LEFT'>in/by (the) Name of</td><td align='LEFT'>Preposition, noun</td><td class='arabic-text'>&#x628;&#x633;&#x645;</td></tr></table>

English Integration

Hit this URL inside an img tag and it will produce the Bangla meaning.

http://www.ovidhan.org/getmeaning.php?word=transcendent

Clone this wiki locally