comparison software/eXist/mpdl-modules/src/de/mpg/mpiwg/berlin/mpdl/lt/general/Transcoder.java @ 6:2396a569e446

new functions: externalObjects, normalizer, Unicode2Betacode
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 08 Feb 2011 14:54:09 +0100
parents 408254cf2f1d
children fba5577e49d9
comparison
equal deleted inserted replaced
5:94305c504178 6:2396a569e446
60 // the longest regular expressions first 60 // the longest regular expressions first
61 61
62 return encodedUnicodeStr; 62 return encodedUnicodeStr;
63 */ 63 */
64 } 64 }
65
65 66
67 public String transcodeFromUnicode2BetaCode(String inputStr) throws ApplicationException {
68 StringReader strReader = new StringReader(inputStr);
69 Unicode2BetacodeLex betacode2UnicodeLex = new Unicode2BetacodeLex(strReader);
70 String retStr = "";
71 String token = "";
72 while (token != null) {
73 try {
74 token = betacode2UnicodeLex.yylex();
75 if (token != null)
76 retStr += token;
77 } catch (IOException e ) {
78 throw new ApplicationException(e);
79 }
80 }
81 return retStr;
82 }
83
84 public String transcodeFromUnicode2Buckwalter(String inputStr) throws ApplicationException {
85 StringReader strReader = new StringReader(inputStr);
86 Unicode2BuckwalterLex betacode2UnicodeLex = new Unicode2BuckwalterLex(strReader);
87 String retStr = "";
88 String token = "";
89 while (token != null) {
90 try {
91 token = betacode2UnicodeLex.yylex();
92 if (token != null)
93 retStr += token;
94 } catch (IOException e ) {
95 throw new ApplicationException(e);
96 }
97 }
98 return retStr;
99 }
100
66 public String transcodeFromBuckwalter2Unicode(String inputStr) throws ApplicationException { 101 public String transcodeFromBuckwalter2Unicode(String inputStr) throws ApplicationException {
67 StringReader strReader = new StringReader(inputStr); 102 StringReader strReader = new StringReader(inputStr);
68 Buckwalter2UnicodeLex buckwalter2UnicodeLex = new Buckwalter2UnicodeLex(strReader); 103 Buckwalter2UnicodeLex buckwalter2UnicodeLex = new Buckwalter2UnicodeLex(strReader);
69 String retStr = ""; 104 String retStr = "";
70 String token = ""; 105 String token = "";