Renamed ACIPConverter to TConverter. Added a needed parameter (the

only needed parameter in that class's interface AFAIK.
This commit is contained in:
dchandler 2005-02-21 01:35:23 +00:00
parent 37bf9a736d
commit 3e0168b384
6 changed files with 42 additions and 37 deletions

View file

@ -26,7 +26,7 @@ import java.io.*;
import org.thdl.util.ThdlDebug;
import org.thdl.tib.text.ttt.ACIPTshegBarScanner;
import org.thdl.tib.text.ttt.ACIPConverter;
import org.thdl.tib.text.ttt.TConverter;
import org.thdl.tib.text.tshegbar.LegalTshegBar;
import org.thdl.tib.text.tshegbar.UnicodeConstants;
import org.thdl.tib.text.tshegbar.UnicodeUtils;
@ -348,9 +348,9 @@ public class TibTextUtils implements THDLWylieConstants {
}
try {
int tloc[] = new int[] { loc };
ACIPConverter.convertToTMW(al, tdoc, null, null, null,
putWarningsInOutput, warningLevel,
false, colors, tloc);
TConverter.convertToTMW(al, tdoc, null, null, null,
putWarningsInOutput, warningLevel,
false, colors, tloc);
return tloc[0] - loc;
} catch (IOException e) {
throw new Error("Can't happen: " + e);

View file

@ -64,9 +64,9 @@ $~38,5~~9,41~~~~~~~0F06
#~200,1~~9,39~~~~~~~0F05
// Yig.mgo.tsheg.shad:
%~39,5~~9,42~~~~~~~0F07
// dbu.khang.g-yon: (If this changes, edit ACIPConverter)
// dbu.khang.g-yon: (If this changes, edit TConverter)
(~208,1~~9,93~~~~~~~0F3C
// dbu.khang.g-yas: (If this changes, edit ACIPConverter)
// dbu.khang.g-yas: (If this changes, edit TConverter)
)~209,1~~9,94~~~~~~~0F3D
H~239,1~~8,92~~~~~~~0F7F
// mtshan.rtags:

View file

@ -209,16 +209,16 @@ public class PackageTest extends TestCase {
= new org.thdl.tib.text.TibetanDocument();
int loc[] = new int[] { 0 };
try {
if (!ACIPConverter.convertToTMW(al,
tdoc,
null,
null,
null,
false,
"None",
false,
false,
loc))
if (!TConverter.convertToTMW(al,
tdoc,
null,
null,
null,
false,
"None",
false,
false,
loc))
return null;
} catch (java.io.IOException e) {
assertTrue("I/O exception?", false);
@ -7680,9 +7680,10 @@ tstHelper("ZUR");
private static void uhelp(String acip, String expectedUnicode,
String warningLevel, boolean shortMessages) {
StringBuffer errors = new StringBuffer();
String unicode = ACIPConverter.convertToUnicodeText(acip, errors, null,
true, warningLevel,
shortMessages);
String unicode = TConverter.convertToUnicodeText("ACIP", acip, errors,
null, true,
warningLevel,
shortMessages);
if (null == unicode) {
if (null != expectedUnicode && "none" != expectedUnicode) {
System.out.println("No unicode exists for " + acip + " but you expected " + org.thdl.tib.text.tshegbar.UnicodeUtils.unicodeStringToPrettyString(expectedUnicode));

View file

@ -35,7 +35,7 @@ import org.thdl.tib.text.DuffCode;
* results as ACIP->TMW followed by TMW->Unicode (FIXME: test it!)
* @author David Chandler
*/
public class ACIPConverter {
public class TConverter {
/** Command-line converter for testing only -- use
* org.thdl.tib.input.TibetanConverter for production work.
@ -55,7 +55,7 @@ public class ACIPConverter {
// Only developers should use this.
if (!ThdlOptions.getBooleanOption("thdl.debug")) {
System.err.println("Use org.thdl.tib.input.TibetanConverter for production work, not ACIPConverter.");
System.err.println("Use org.thdl.tib.input.TibetanConverter for production work, not TConverter.");
System.exit(1);
}
@ -137,7 +137,6 @@ public class ACIPConverter {
* prefix rules in another
* @throws IOException if we cannot write to out
*/
// TODO(DLC)[EWTS->Tibetan]: misnamed source file, this is TConverter.java nowadays
public static boolean convertToTMW(ArrayList scan,
OutputStream out,
StringBuffer errors,
@ -197,12 +196,17 @@ public class ACIPConverter {
* messages are long and self-contained unless shortMessages is
* true. Returns the conversion upon perfect success or if there
* were merely warnings, null if errors occurred. */
public static String convertToUnicodeText(String acip,
public static String convertToUnicodeText(String transliteration,
String acip,
StringBuffer errors,
StringBuffer warnings,
boolean writeWarningsToResult,
String warningLevel,
boolean shortMessages) {
if (transliteration != "ACIP") {
ThdlDebug.noteIffyCode();
throw new IllegalArgumentException("Unsupported transliteration");
}
ByteArrayOutputStream sw = new ByteArrayOutputStream();
ArrayList al = ACIPTshegBarScanner.scan(acip, errors, -1, shortMessages,
warningLevel);