Difference between revisions of "Translating wikimedia"

From Apertium
Jump to navigation Jump to search
Line 1: Line 1:
To translate wikimedia formatted text, there are several options.
To translate wikimedia formatted text, like Wikipedia articles, there are several options.
* '''apertium-desmediawiki/-remediawiki''' in the apertium package is installed by default, but only handles the basics
* '''apertium-desmediawiki/-remediawiki''' in the apertium package is installed by default, but only handles the basics
** Usage: <code>cat file.wiki | apertium-desmediawiki | apertium -f none es-ca | apertium-remediawiki</code>
** Usage: <code>cat es-article.wiki | apertium-desmediawiki | apertium -f none es-ca | apertium-remediawiki > ca-article.wiki</code>
* '''apertium-mediawiki''' -- a newer work-in-progress format handler that handles links better (see below)
* '''apertium-mediawiki''' -- a newer work-in-progress format handler that handles links better (see below)
* [http://www.mediawiki.org/wiki/Extension:Translate '''Mediawiki Extension:Translate'''] -- if you run a wiki, you can install this to use Apertium through it
* [http://www.mediawiki.org/wiki/Extension:Translate '''Mediawiki Extension:Translate'''] -- if you run a wiki, you can install this to use Apertium through it
Line 7: Line 7:
* you can run a clean-up script such as [http://apertium.svn.sourceforge.net/viewvc/apertium/trunk/apertium-nn-nb/wikifix-nb-nn.pl?view=markup&sortby=date '''wikifix.pl'''] after just using the regular format handler
* you can run a clean-up script such as [http://apertium.svn.sourceforge.net/viewvc/apertium/trunk/apertium-nn-nb/wikifix-nb-nn.pl?view=markup&sortby=date '''wikifix.pl'''] after just using the regular format handler


you can install the apertium-mediawiki [[Format handling|format handler]] and use it like you would use the HTML format handler. The wikimedia format handler is still a work-in-progress.


== apertium-mediawiki ==
== apertium-mediawiki ==
This is a work-in-progress full format handler for mediawiki.


Download and compile like this:
To install:


svn co https://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium-mediawiki
svn co https://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium-mediawiki
sh make.sh
sh make.sh

There's no real makefile yet, so just put that directory in your $PATH, e.g. by adding <code>PATH=/path/to/apertium-mediawiki:$PATH</code> into your <code>~/.bash_profile</code>.

Open a new terminal and you should be able to do

cat es-article.wiki | demediawiki | apertium -f none es-ca | remediawiki > ca-article.wiki


==See also==

* [[Wikitrans]]

[[Category:Development]]
[[Category:Formats]]

Revision as of 08:33, 21 February 2011

To translate wikimedia formatted text, like Wikipedia articles, there are several options.

  • apertium-desmediawiki/-remediawiki in the apertium package is installed by default, but only handles the basics
    • Usage: cat es-article.wiki | apertium-desmediawiki | apertium -f none es-ca | apertium-remediawiki > ca-article.wiki
  • apertium-mediawiki -- a newer work-in-progress format handler that handles links better (see below)
  • Mediawiki Extension:Translate -- if you run a wiki, you can install this to use Apertium through it
but can you actually translate wikimedia-formatted articles with it, or just po-files and such?
  • you can run a clean-up script such as wikifix.pl after just using the regular format handler


apertium-mediawiki

This is a work-in-progress full format handler for mediawiki.

Download and compile like this:

   svn co https://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium-mediawiki
   sh make.sh

There's no real makefile yet, so just put that directory in your $PATH, e.g. by adding PATH=/path/to/apertium-mediawiki:$PATH into your ~/.bash_profile.

Open a new terminal and you should be able to do

   cat es-article.wiki | demediawiki | apertium -f none es-ca | remediawiki > ca-article.wiki


See also