Wednesday, December 21, 2011

Synonym filter by Nadav Kavalerchik and Big Huge Thesaurus

Here's a wonderful synonym filter I've just discovered for Moodle. If you teach English you might be interested in this. Maybe even excited.

What's the fuss about? Well here's a filter that allows the user to generate a tool-tip list of synonyms and antonyms just with the push of a mouse icon.


Works great with Google Chrome. Note the clean and tidy appearance below:

The filter doesn't work well with Mozilla Firefox 8.0 since the tooltip keeps disappearing. Note also the disorganised array of synonyms and antonyms displayed compared to


1. Here's the filter for you to download.

2. Extract the zip file and ftp the synonym folder to your Moodle site's filter folder.

3. Next head over to and sign up for a free account.

4. Then get an API key from the same website.

5. Then edit the file filter.php and locate the line that starts with
$apikey = '...';
    and copy and paste your BigHugeLabs API key inside the pair of apostrophes.

6. Go to Administration | Notification on your Moodle site.

7. Sure that the synonym filter's "eye" is on. Activate the filter.

8. To use it, inside a label, webpage or inside Moodle's editor,
    add the text [s: before your word, and ] after your word.
    For example

Note: The filter.php has a slight modification to it (done by me!) so that words that end with a comma, fullstop or come just before a space, can be filtered into a synonym tool-tip link.

To change the color code of the tool-tip word, modify this code on line 62 from
$replace = '<span style="border-bottom:1px dashed blue;border-color:blue;" title="'.$synonyms.'">'.$synonym->word.'</span>&nbsp;';
$replace = '<span style="color:#005476;" title="'.$synonyms.'">'.$synonym->word.'</span>&nbsp;';
for example.

The effect will be the tool-tip text will not have the dashed underline,but rather be of a certain blue colour that could match your Moodle site's theme (at least for my site it matches!). See image below:

So what do you think of the change? Does it improve readability?

Have fun.
Remember to use Google Chrome.

Frankie Kam

If you like this post or site
a small donation would be nice but would last only a day,
otherwise leaving a comment (or a compliment) below will last me a month!

No comments:

Post a Comment

Ratings and Recommendations by outbrain