Renamed TMW_RTF_TO_THDL_WYLIE TibetanConverter.
This commit is contained in:
parent
34a7b5da9b
commit
ced830a7d3
4 changed files with 19 additions and 21 deletions
|
@ -296,12 +296,12 @@
|
||||||
<param name="my.included.source.file"
|
<param name="my.included.source.file"
|
||||||
value="org/thdl/tib/text/TibetanHTML.java"/>
|
value="org/thdl/tib/text/TibetanHTML.java"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<!-- Put TMW_RTF_TO_THDL_WYLIE in Jskad's jar for those who want
|
<!-- Put TibetanConverter in Jskad's jar for those who want
|
||||||
to use it. -->
|
to use it. -->
|
||||||
<antcall target="our-internal-javac-task">
|
<antcall target="our-internal-javac-task">
|
||||||
<param name="mybin" value="${jskadbin}"/>
|
<param name="mybin" value="${jskadbin}"/>
|
||||||
<param name="my.included.source.file"
|
<param name="my.included.source.file"
|
||||||
value="org/thdl/tib/input/TMW_RTF_TO_THDL_WYLIE.java"/>
|
value="org/thdl/tib/input/TibetanConverter.java"/>
|
||||||
</antcall>
|
</antcall>
|
||||||
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
|
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
|
||||||
<param name="mybin" value="${jskadbin}"/>
|
<param name="mybin" value="${jskadbin}"/>
|
||||||
|
|
|
@ -739,7 +739,7 @@ public class Jskad extends JPanel implements DocumentListener {
|
||||||
newRTF.dp.rtfEd.read(in, newRTF.dp.getDocument(), 0);
|
newRTF.dp.rtfEd.read(in, newRTF.dp.getDocument(), 0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
JOptionPane.showMessageDialog(newFrame,
|
JOptionPane.showMessageDialog(newFrame,
|
||||||
TMW_RTF_TO_THDL_WYLIE.rtfErrorMessage);
|
TibetanConverter.rtfErrorMessage);
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
in.close();
|
in.close();
|
||||||
|
@ -767,7 +767,7 @@ public class Jskad extends JPanel implements DocumentListener {
|
||||||
dp.rtfEd.read(in, dp.getDocument(), 0);
|
dp.rtfEd.read(in, dp.getDocument(), 0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
JOptionPane.showMessageDialog(this,
|
JOptionPane.showMessageDialog(this,
|
||||||
TMW_RTF_TO_THDL_WYLIE.rtfErrorMessage);
|
TibetanConverter.rtfErrorMessage);
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.thdl.util.javaxdelta.Delta;
|
||||||
/**
|
/**
|
||||||
* @author David Chandler
|
* @author David Chandler
|
||||||
*
|
*
|
||||||
* Tests {@link org.thdl.tib.input.TMW_RTF_TO_THDL_WYLIE} at the unit level.
|
* Tests {@link org.thdl.tib.input.TibetanConverter} at the unit level.
|
||||||
*/
|
*/
|
||||||
public class TMW_RTF_TO_THDL_WYLIETest extends TestCase {
|
public class TMW_RTF_TO_THDL_WYLIETest extends TestCase {
|
||||||
/**
|
/**
|
||||||
|
@ -85,7 +85,7 @@ public class TMW_RTF_TO_THDL_WYLIETest extends TestCase {
|
||||||
};
|
};
|
||||||
boolean fileNotFound = false;
|
boolean fileNotFound = false;
|
||||||
try {
|
try {
|
||||||
int rc = TMW_RTF_TO_THDL_WYLIE.realMain(args, new PrintStream(new FileOutputStream("bin/for-junit/TMW_RTF_TO_THDL_WYLIETest1Result" + extension + ".out")));
|
int rc = TibetanConverter.realMain(args, new PrintStream(new FileOutputStream("bin/for-junit/TMW_RTF_TO_THDL_WYLIETest1Result" + extension + ".out")));
|
||||||
assertTrue(rc == erc);
|
assertTrue(rc == erc);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
fileNotFound = true;
|
fileNotFound = true;
|
||||||
|
@ -106,25 +106,25 @@ public class TMW_RTF_TO_THDL_WYLIETest extends TestCase {
|
||||||
|
|
||||||
|
|
||||||
/** Tests the --find-some-non-tmw mode of {@link
|
/** Tests the --find-some-non-tmw mode of {@link
|
||||||
* org.thdl.tib.input.TMW_RTF_TO_THDL_WYLIE}. */
|
* org.thdl.tib.input.TibetanConverter}. */
|
||||||
public void testFindSomeNonTMWMode() {
|
public void testFindSomeNonTMWMode() {
|
||||||
helper("--find-some-non-tmw", "FindSome", 1);
|
helper("--find-some-non-tmw", "FindSome", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Tests the --find-all-non-tmw mode of {@link
|
/** Tests the --find-all-non-tmw mode of {@link
|
||||||
* org.thdl.tib.input.TMW_RTF_TO_THDL_WYLIE}. */
|
* org.thdl.tib.input.TibetanConverter}. */
|
||||||
public void testFindAllNonTMWMode() {
|
public void testFindAllNonTMWMode() {
|
||||||
helper("--find-all-non-tmw", "FindAll", 1);
|
helper("--find-all-non-tmw", "FindAll", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Tests the --to-wylie converter mode of {@link
|
/** Tests the --to-wylie converter mode of {@link
|
||||||
* org.thdl.tib.input.TMW_RTF_TO_THDL_WYLIE}. */
|
* org.thdl.tib.input.TibetanConverter}. */
|
||||||
public void testConverterMode() {
|
public void testConverterMode() {
|
||||||
helper("--to-wylie", "Conversion", 0);
|
helper("--to-wylie", "Conversion", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Tests the --to-tibetan-machine converter mode of {@link
|
/** Tests the --to-tibetan-machine converter mode of {@link
|
||||||
* org.thdl.tib.input.TMW_RTF_TO_THDL_WYLIE}. */
|
* org.thdl.tib.input.TibetanConverter}. */
|
||||||
public void testTMConverterMode() {
|
public void testTMConverterMode() {
|
||||||
helper("--to-tibetan-machine", "TM", 0);
|
helper("--to-tibetan-machine", "TM", 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,7 @@ import java.io.*;
|
||||||
import org.thdl.util.*;
|
import org.thdl.util.*;
|
||||||
import org.thdl.tib.text.*;
|
import org.thdl.tib.text.*;
|
||||||
|
|
||||||
/** DLC FIXME: this is misnamed
|
/** TibetanConverter is a command-line utility for converting to
|
||||||
*
|
|
||||||
* TMW_RTF_TO_THDL_WYLIE is a command-line utility for converting to
|
|
||||||
* and from Tibetan Machine Web (TMW). It converts TMW to Wylie, to
|
* and from Tibetan Machine Web (TMW). It converts TMW to Wylie, to
|
||||||
* Unicode, or to Tibetan Machine (TM). It also converts TM to TMW.
|
* Unicode, or to Tibetan Machine (TM). It also converts TM to TMW.
|
||||||
* It is a TibetanMachineWeb-in-RichTextFormat to your choice of
|
* It is a TibetanMachineWeb-in-RichTextFormat to your choice of
|
||||||
|
@ -34,7 +32,7 @@ import org.thdl.tib.text.*;
|
||||||
* more specifically, as well as converting from TM to TMW. Invoke
|
* more specifically, as well as converting from TM to TMW. Invoke
|
||||||
* it with no parameters for usage information.
|
* it with no parameters for usage information.
|
||||||
* @author David Chandler */
|
* @author David Chandler */
|
||||||
public class TMW_RTF_TO_THDL_WYLIE {
|
public class TibetanConverter {
|
||||||
static final String rtfErrorMessage
|
static final String rtfErrorMessage
|
||||||
= "The Rich Text Format (RTF) file selected contains constructs that\nJskad cannot handle. If you got the RTF file from saving a Word\ndocument as RTF, try saving that same document as RTF in\nWord 2000 instead of Word XP or in Word 97 instead of\nWord 2000. Older versions of Word produce RTF that Jskad\ncan more easily deal with. OpenOffice and StarOffice may also\nproduce better-behaved RTF.";
|
= "The Rich Text Format (RTF) file selected contains constructs that\nJskad cannot handle. If you got the RTF file from saving a Word\ndocument as RTF, try saving that same document as RTF in\nWord 2000 instead of Word XP or in Word 97 instead of\nWord 2000. Older versions of Word produce RTF that Jskad\ncan more easily deal with. OpenOffice and StarOffice may also\nproduce better-behaved RTF.";
|
||||||
|
|
||||||
|
@ -77,10 +75,10 @@ public class TMW_RTF_TO_THDL_WYLIE {
|
||||||
= args[0].equals("--to-wylie"))
|
= args[0].equals("--to-wylie"))
|
||||||
|| (findSomeNonTMWMode
|
|| (findSomeNonTMWMode
|
||||||
= args[0].equals("--find-some-non-tmw"))))) {
|
= args[0].equals("--find-some-non-tmw"))))) {
|
||||||
out.println("TMW_RTF_TO_THDL_WYLIE [--find-all-non-tmw | --find-some-non-tmw");
|
out.println("TibetanConverter [--find-all-non-tmw | --find-some-non-tmw");
|
||||||
out.println(" | --to-tibetan-machine | --to-tibetan-machine-web");
|
out.println(" | --to-tibetan-machine | --to-tibetan-machine-web");
|
||||||
out.println(" | --to-unicode | --to-wylie] RTF_file");
|
out.println(" | --to-unicode | --to-wylie] RTF_file");
|
||||||
out.println(" | TMW_RTF_TO_THDL_WYLIE [--version | -v | --help | -h]");
|
out.println(" | TibetanConverter [--version | -v | --help | -h]");
|
||||||
out.println("");
|
out.println("");
|
||||||
out.println("Distributed under the terms of the THDL Open Community License Version 1.0.");
|
out.println("Distributed under the terms of the THDL Open Community License Version 1.0.");
|
||||||
out.println("");
|
out.println("");
|
||||||
|
@ -111,7 +109,7 @@ public class TMW_RTF_TO_THDL_WYLIE {
|
||||||
return 77;
|
return 77;
|
||||||
}
|
}
|
||||||
if (args[0].equals("--version") || args[0].equals("-v")) {
|
if (args[0].equals("--version") || args[0].equals("-v")) {
|
||||||
out.println("TMW_RTF_TO_THDL_WYLIE version 0.82");
|
out.println("TibetanConverter version 0.82");
|
||||||
out.println("Compiled at "
|
out.println("Compiled at "
|
||||||
+ ThdlVersion.getTimeOfCompilation());
|
+ ThdlVersion.getTimeOfCompilation());
|
||||||
return 77;
|
return 77;
|
||||||
|
@ -125,7 +123,7 @@ public class TMW_RTF_TO_THDL_WYLIE {
|
||||||
try {
|
try {
|
||||||
dp.rtfEd.read(in, dp.getDocument(), 0);
|
dp.rtfEd.read(in, dp.getDocument(), 0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
out.println("TMW_RTF_TO_THDL_WYLIE:\n"
|
out.println("TibetanConverter:\n"
|
||||||
+ rtfErrorMessage);
|
+ rtfErrorMessage);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -184,7 +182,7 @@ public class TMW_RTF_TO_THDL_WYLIE {
|
||||||
return exitCode;
|
return exitCode;
|
||||||
}
|
}
|
||||||
} catch (ThdlLazyException e) {
|
} catch (ThdlLazyException e) {
|
||||||
out.println("TMW_RTF_TO_THDL_WYLIE has a BUG:");
|
out.println("TibetanConverter has a BUG:");
|
||||||
e.getRealException().printStackTrace(out);
|
e.getRealException().printStackTrace(out);
|
||||||
return 7;
|
return 7;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
Loading…
Reference in a new issue