Extension:Svetovid

Svetovid (Polish: Świętowit, a Slavic deity of war, fertility and abundance) is an extension that provides grammar-aware link creation assistance.

This extension was developed with the Polish language in mind, but it could potentially be used with other declensed languages. Slavic languages should be relatively easy to implement, as they have similar grammar structure, other languages may require more changes. If you are interested in using Svetovid with a different language, please contact this extension's creator.

Installation
Now, this is a crazy extension and installing it is all but easy. Venture further on your own mental health risk.

Configuration

 * $wgSvetovidMorfeuszURL: The URL to the Morfoapi morphological service. Default is  (the default port Morfoapi will listen on).
 * $wgSvetovidSearchCacheExpiry: How long search results will be cached in seconds (i.e. how long a user can use retrieved results to edit pages). Default is 7200 (two hours).
 * $wgSvetovidSearchBlacklist: Titles that should not be returned in search results, you can for example add there your Main Page. Default is an empty array.

Usage
See below for screenshots of every step described here.

Let's say you decide the article about Abraham Lincoln does not have enough backlinks. To fix that, visit the special page Special:LinkCreator, or just click the Link creator link in your toolbox if you enabled this option in your preferences. After selecting the page you want to work with (i.e. link to), the creator will try to interpret the text you entered in terms of grammar. This is neccessary, as in Polish grammar is not always unequivocal. In this case, Lincoln can mean a surname and a brand of a car. They declense differently (they have a different grammatical grammatical gender), so we have to choose the right interpretation. This interpretation could be also extracted automatically from the context by using a syntax analyzer. This is not implemented yet, but may be added in the future.

After selecting interpretations for all words in the query text (which in this case is the same as the page title, but that can be changed), the creator automatically declenses the text in all cases and both numbers. You can then correct this (there is usually no need to, these are taken from a high quality dictionary) and specify other search options, such as omitting pages that already link to the page you are working with. Only direct links count, though, so no navboxes will affect that. What's a direct link? You can read about that on the AdvancedBacklinks extension page.

The only thing left to do is hit the search button. Then you will be presented with a list of pages that can link to the page you are working with, together with incoming and outgoing direct link count. When you click the edit button, a new browser tab will open with the standard wikitext editor. The links are added automatically, but you can always review the changes before saving. That's it!

How it works
For grammar things (analysis and generation) Svetovid uses the Morfeusz 2 library provided by the Polish Academy of Sciences. This tool uses a compiled dictionary in the form of finite state automata to perform very efficient morphological analysis and generation. The library is operated by a separate program, Morfoapi, which exposes some Morfeusz functionality over a REST API and does some additional processing on the queries. It is very fast thanks to being written in C++ and the amount of communication between it and MediaWiki is minimized to a single request per search to keep overhead as small as possible.

Why was this created and the why is this on mediawiki.org?
TBD