Wiktionary-dump-to-Redis is a project mainly written in Perl, it's free.
Take a Wiktionary dump file, import it into Redis to lookup definitions in your own projects.
This is a simple script designed to read one or more Wiktionary XML dump files and import definitions into Redis. It needs more far rigorous testing, but the results seem good enough to experiment with.
$ wiktionary_to_redis.pl
You can import one or multiple files. Definitions in files listed first are used. This was designed to use definitions from Simple Wiktionary if available, then English Wiktionary as a fallback.
Make sure Redis (http://redis.io) is running first.
Definitions are imported as a list with format
After the import is finished, you can access definitions like this:
$ redis-cli redis> LRANGE sink 0 -1
Queries with spaces need to use quote marks via the Redis CLI:
redis> LRANGE "Pacific Ocean" 0 -1
Dump files are available from:
http://dumps.wikimedia.org/
Currently, it's only been tested to work with the Simple English and English sites:
http://download.wikimedia.org/simplewiktionary/latest/simplewiktionary- latest-pages-articles.xml.bz2 http://download.wikimedia.org/enwiktionary/latest/enwiktionary-latest- pages-articles.xml.bz2
Wiki markup on other Wiktionary sites varies, so I can't guarantee it will work for anything else. By default, it will assume the same markup as English Wiktionary.
If you're running the script with updated dump data, current definitions won't be updated, but new words will be added.
If you want to re-import a new dump into the dictionary, you'll need to clear the data already in Redis to avoid duplicate definitions:
$ redis-cli redis> flushall
Redis MediaWiki::DumpFile Data::Dumper