view software/mpdl-services/mpiwg-mpdl-lt/lib/README-transcoder @ 19:4a3641ae14d2

Erstellung
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Wed, 09 Nov 2011 15:32:05 +0100
parents
children
line wrap: on
line source

********************************************************************************
* TransCoder README                                                            *
********************************************************************************
What it is:
	A library of Java classes designed to translate Ancient Greek from one encoding to another.
	
License:
	This software is copyright Hugh A. Cayless.  It is licensed under the terms of the GNU LGPL, see
	See http://www.gnu.org/licenses/lgpl.html for details.
	
Supported encodings:
	At the moment, there are classes for reading Beta Code, GreekKeys, and Unicode and for outputting Beta Code, precomposed Unicode (form C) and Unicode with combining diacriticals (form D).  
	
How to use it:
	The classes that do the work implement the Parser and Converter interfaces.  These may be loaded and accessed by the TransCoder class. The following code snippet creates a TransCoder and uses it to transform a Greek text file written in GreekKeys to a Unicode string.  The transcoder.jar file now includes a GUI form which can be used for testing the conversion of various font encodings.  The .jar file is executable, so it should be possible to run it by double clicking on the icon or executing it from the command line (java -jar transcoder.jar).
	
	<code>
	    TransCoder tc = new TransCoder("GreekKeys", "UnicodeC");
	    String result = tc.getString(new File("C:/temp/test.txt"));
	</code>
	
	or
	
	<code>
	    String source = "A)/NDRA MOI E)/NNEPE, MOU=SA";
	    TransCoder tc = new TransCoder();
	    tc.setParser("Unicode");
	    tc.setConverter("BetaCode");
	    String result = tc.getString(source);
	</code>