Extension:DidYouMean

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
DidYouMean

Release status: experimental

Implementation User interface
Description adds links to articles with "similar" titles, where what is similar can be decided by a PHP function.
Author(s) Hippietrail
License No license specified
Download
Hooks used
ArticleSaveComplete

Debug
ParserBeforeStrip
ParserTestTables
SpecialSearchResults
SpecialSearchNoResults
TitleMoveComplete
User

Translate the DidYouMean extension if it is available at translatewiki.net

Check usage and version matrix; code metrics
Bugs: list open list all report

DidYouMean is an extension under development by Hippietrail that adds links to articles with "similar" titles, where what is similar can be decided by a PHP function.

History[edit | edit source]

The English Wiktionary has long used the templates {{see}} and {{xsee}} to link articles which differ only by capitalisation, use of accents, or nonletter characters such as hyphens, apostrophes, and spaces.

  • ivy / Ivy; faith / Faith; frank / Frank
  • façade / facade; café / cafe; naïve / naive
  • showoff / show off / show-off

Installation[edit | edit source]

Go to the command line, cd to the mediawiki extensions directory, and run:

sudo svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/DidYouMean/

Then to install run php install.php from the DidYouMean directory

Finally add the following to LocalSettings.php

require_once("$IP/extensions/DidYouMean/DidYouMean.php");

Automation[edit | edit source]

The extension will look up its extra database tables under three conditions:

  1. A page is displayed but other pages have similar titles and might be the one the user really wants.
  2. A page doesn't exist under the exact title given by the user but others with similar titles do.
  3. Search didn't find the exact title the users entered but similar titles exist.

Interface[edit | edit source]

  • The output will initially be designed to mimic the English Wiktionary's output for its template.
  • If a page has a {{see}} template, any items listed there will also be output. This allows adding redlinks for titles the similarity function does not yet know about.

Design issues[edit | edit source]

  1. No hook yet exists for condition #2 and there are three places in the code where the noarticletext message is displayed so I'm not sure where to add such a hook.
  2. Metadata must be tracked whenever a title enters or leaves the scope of the DidYouMean extension and whenever it changes names. Hooks specifically designed for metadata tracking do not yet exist and there are issues with the hooks that I have used.

Similarity[edit | edit source]

There are many ways in which article titles might be considered similar apart from what matters to the English Wiktionary.

  • Soundex and Metaphone are well-known algorithms used for finding words based on their pronunciation.
  • Textonyms: book, cool, cook, conk, amok, and bonk are all entered into a telephone keypad as 2665.
  • wikipedia:Anagrams: coordinate, decoration, carotenoid are all spelled with the same letters.
  • Stemming: work, works, worked, working; and perhaps worker and workers etc.

Particularly Soundex and Metaphone would be useful on all wikis including Wikipedia. Others might only be of interest to some Wiktionaries.

With a little more work it should be possible to add full spellchecker type support such as missing letters, extra letters, and transposed letters. This would certainly be useful for all wikis.


External links[edit | edit source]