Giter Club home page Giter Club logo

dict-lookup-chrome-ext's Introduction

Dictionary Lookup for Chrome

Dictionary Lookup is a Chrome extension that allows you to quickly look up definitions of words and phrases in a clean inline box. The definitions come from Wiktionary, but have been preprocessed to reduce formatting and provide faster lookup. Hold Alt and double-click or select any word to look it up - an inline box will open to the dictionary entry of that word, usually including examples, audio pronunciation and synonyms.

Parts

The application is powered by three separate parts:

  • The actual Chrome extension that is embedded in pages, queries the lookup server for definitions and formats them for display. Written in Javascript.
  • The lightweight lookup server script that receives word or phrase queries and returns matches from a local database. It also does some trivial spelling suggestions based on a a Soundex index. Written in PHP. The canonical server is hosted on http://dictionary-lookup.org/.
  • The scripts which parse a Wiktionary dump and produce a database of machine readable definitions appropriate for quick lookup. Written mainly in Python.

Building

The extension itself, located in the extension subfolder, does not require building - it can be loaded or packed into a CRX by Chrome as is.

The lookup server script, located in the lookup_server subfolder, does not require building either. However, it expects the lookup database built by the Wiktionary parser to be accessible - the database settings can be edited at the top of the file (the $MYSQL_* variables).

The Wiktionary parser is a little more complicated. Here's a step-by-step guide to running the whole thing:

  1. Run wiktionary_setup/build-mediawiki.sh to create a MediaWiki installation with the ExpandTemplates and ParserFunctions extensions and the additions needed by the Wiktionary parser. This is a dummy server that is only used to expand Wiktionary templates. You may need to edit the database settings in wiktionary_setup/build-mediawiki.sh before running the script. Note that this script requires the following commands to be available:
    • wget: for getting the MediaWiki source tarball.
    • tar: for unpacking the source tarball.
    • patch: for applying parser-specific patches.
    • svn: for getting the required mediawiki extensions.
    • mysql: for creating the databases (mysqld must be running).
  2. Setup a PHP-enabled Apache server and make sure it serves the mediawiki folder created in the previous step. It is not necessary (or recommended) to serve directly from the DocumentRoot.
  3. Edit mediawiki/LocalSettings.php to set the database connection details ($wgDB*) and the URL path from which the mediawiki folder is served ($wgScriptPath).
  4. Test that the MediaWiki server is working by pointing your browser at the path from which MediaWiki is being served. It should return an empty page with the HTTP status code 200.
  5. Download and extract a Wiktionary dump, e.g. from: http://dumps.wikimedia.org/enwiktionary/latest/enwiktionary-latest-pages-articles.xml.bz2
  6. Adjust the database, dump path and URL settings in wiktionary/__main__.py.
  7. Run wiktionary/__main__.py. This should execute the whole pipeline.
  8. If everything went right, the final database in the format used by the lookup server will be in LOOKUP_DB (as specified in wiktionary/__main__.py).

dict-lookup-chrome-ext's People

Contributors

max99x avatar

Watchers

James Cloos avatar Santosh Viswanatham avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.