The Wylie 'M' used to map to TMW7.91, when it should map to TMW7.90.

I've fixed that.

I've also added a couple of Unicode mappings to give a flavor for how
multi-codepoint mappings will be represented.

TM->TMW conversion takes about 1 second per thousand glyphs on my
PIII-550.
This commit is contained in:
dchandler 2003-06-01 23:05:32 +00:00
parent 54ca37c824
commit 0f724989b5
4 changed files with 184 additions and 94 deletions

View file

@ -327,14 +327,39 @@ public class Jskad extends JPanel implements DocumentListener {
JMenuItem toTMItem = new JMenuItem("Convert TMW to TM"); // DLC FIXME: do it just in the selection?
toTMItem.addActionListener(new ThdlActionListener() {
public void theRealActionPerformed(ActionEvent e) {
((TibetanDocument)dp.getDocument()).convertToTM(0, -1); // entire document
StringBuffer errors = new StringBuffer();
boolean errorReturn
= ((TibetanDocument)dp.getDocument()).convertToTM(0, -1, errors); // entire document
if (errorReturn) {
JOptionPane.showMessageDialog(Jskad.this,
"At least one error occurred while converting Tibetan Machine Web\nto Tibetan Machine. Your document is mostly converted,\nexcept for the glyphs found after the 72-point Tibetan Machine Web\n30-letter alphabet.\nThe following glyphs were problems:\n"
+ errors.toString(),
"TMW to TM Errors",
JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(Jskad.this,
"Converting Tibetan Machine Web to Tibetan Machine met with perfect success.",
"Success", JOptionPane.PLAIN_MESSAGE);
}
}
});
JMenuItem toTMWItem = new JMenuItem("Convert TM to TMW"); // DLC FIXME: do it just in the selection?
toTMWItem.addActionListener(new ThdlActionListener() {
public void theRealActionPerformed(ActionEvent e) {
((TibetanDocument)dp.getDocument()).convertToTMW(0, -1); // entire document
StringBuffer errors = new StringBuffer();
boolean errorReturn
= ((TibetanDocument)dp.getDocument()).convertToTMW(0, -1, errors); // entire document
if (errorReturn) {
JOptionPane.showMessageDialog(Jskad.this,
"At least one error occurred while converting Tibetan Machine\nto Tibetan Machine Web. Your document is mostly converted,\nexcept for the glyphs found after the 72-point Tibetan Machine Web\n30-letter alphabet.\nThe following glyphs were problems:\n"
+ errors.toString(),
"TM to TMW Errors", JOptionPane.PLAIN_MESSAGE);
} else {
JOptionPane.showMessageDialog(Jskad.this,
"Converting Tibetan Machine to Tibetan Machine Web met with perfect success.",
"Success", JOptionPane.PLAIN_MESSAGE);
}
}
});
toolsMenu.addSeparator();

View file

@ -89,7 +89,8 @@ public class TMW_RTF_TO_THDL_WYLIE {
out.println(" file. Writes the THDL Extended Wylie transliteration of that file [in");
out.println(" --to-wylie mode] or the TibetanMachine equivalent of that file [in");
out.println(" --to-tibetan-machine mode] to standard output after dealing with the curly");
out.println(" brace problem. Exit code is zero on success, nonzero otherwise.");
out.println(" brace problem. Exit code is zero on success, 42 if some TibetanMachine glyphs");
out.println(" couldn't be understood (though output is still given), nonzero otherwise.");
out.println("");
out.println(" You may find it helpful to use `--find-some-non-tmw' mode before doing a");
out.println(" conversion so that you have confidence in the conversion's correctness.");
@ -126,7 +127,8 @@ public class TMW_RTF_TO_THDL_WYLIE {
} else { // conversion {to Wylie or TM} mode
// Fix curly braces in the entire document:
((TibetanDocument)dp.getDocument()).replaceTahomaCurlyBracesAndBackslashes(0, -1);
int exitCode = 0;
if (convertToWylieMode) {
ThdlDebug.verify(!convertToTMMode);
// Convert to THDL Wylie:
@ -134,14 +136,14 @@ public class TMW_RTF_TO_THDL_WYLIE {
} else {
ThdlDebug.verify(convertToTMMode);
// Convert to TibetanMachine:
((TibetanDocument)dp.getDocument()).convertToTM(0, dp.getDocument().getLength());
if (!((TibetanDocument)dp.getDocument()).convertToTM(0, dp.getDocument().getLength(), null))
exitCode = 42;
}
// Write to standard output the result:
((TibetanDocument)dp.getDocument()).writeRTFOutputStream(out);
// Exit normally:
return 0;
return exitCode;
}
} catch (ThdlLazyException e) {
out.println("TMW_RTF_TO_THDL_WYLIE has a BUG:");