Converter for FreeDict.org databases: from P4 to P5

The input dictionaries vary in some details, so expect to tweak this script. In some cases the tweaks may be worth porting back to the project, in some cases you will probably judge them as specific to the dictionary at hand. In general, this is going to be a one-time script: it should do most of the conversion work for you, and you will be left with the remaining details, hopefully only within the header. Please make sure to indicate in the revisionDesc that conversion has taken place! And then check if the FreeDict build system converts your TEI source to c5 properly.

It presupposes that your working copy of Freedict starts at (SVN/)freedict/trunk/ (you really don't need the other directories besides the trunk/) and that there is a copy of Sebastian Rahtz's TEI Stylesheets located in (SVN/)TEI/Stylesheets/ (this is only relevant for the xsl:import statement; but without that statement this script won't do its job).

Piotr BaƄski the author(s), 2010; license: GPL v3 or any later version (http://www.gnu.org/licenses/gpl.html). $Id$
Convert trans to as many (sense/)cit as there are tr elements inside it. If the original dictionary has no sense elements under entry, create them around each old trans. Convert gen elements *inside* trans. Be careful: this is a very specific case and you may have to tweak this template for your database (probably by removing the gramGrp layer) Convert pos elements *inside* trans. Be careful: this is a very specific case and you may have to tweak this template for your database (possibly by removing the gramGrp layer; mind also the template for trans/gen - if more such elements occur in a trans, it might be better to group them in a more nifty way) YOUR_NAME_HERE: Conversion of TEI P4 source into P5 via tools/xsl/freedict_P4toP5.xsl; manual clean-up. http://freedict.org/

This dictionary comes to you through nice people making it available for free and for good. It is part of the FreeDict project, http://freedict.org/. This project aims to make translating dictionaries available for free. Your contributions are welcome!

for the freedict database Maintainer [up for grabs] $Id:$

Copyright (C) 1999-2010 by various authors listed below.

Available under the terms of the GNU General Public License ver. 2.0 and any later version.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

eat the default or unnecessary attributes