comparison 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
comparison
equal deleted inserted replaced
18:dc5e9fcb3fdc 19:4a3641ae14d2
1 ********************************************************************************
2 * TransCoder README *
3 ********************************************************************************
4 What it is:
5 A library of Java classes designed to translate Ancient Greek from one encoding to another.
6
7 License:
8 This software is copyright Hugh A. Cayless. It is licensed under the terms of the GNU LGPL, see
9 See http://www.gnu.org/licenses/lgpl.html for details.
10
11 Supported encodings:
12 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).
13
14 How to use it:
15 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).
16
17 <code>
18 TransCoder tc = new TransCoder("GreekKeys", "UnicodeC");
19 String result = tc.getString(new File("C:/temp/test.txt"));
20 </code>
21
22 or
23
24 <code>
25 String source = "A)/NDRA MOI E)/NNEPE, MOU=SA";
26 TransCoder tc = new TransCoder();
27 tc.setParser("Unicode");
28 tc.setConverter("BetaCode");
29 String result = tc.getString(source);
30 </code>
31