ACIP->TMW now supports EWTS PUA {\uF021}-style escapes. Our extended ACIP is thus TMW-complete and useful for testing.
This commit is contained in:
parent
8f7322a056
commit
a39c5c12b0
3 changed files with 36 additions and 7 deletions
|
@ -607,8 +607,18 @@ public class ACIPConverter {
|
|||
}
|
||||
continue;
|
||||
} else if (stype == TString.UNICODE_CHARACTER) {
|
||||
ThdlDebug.verify(1 == s.getText().length());
|
||||
if (null != writer) {
|
||||
unicode = s.getText();
|
||||
char ch = s.getText().charAt(0);
|
||||
if (ch >= '\uF021' && ch <= '\uF0FF') {
|
||||
hasErrors = true;
|
||||
String errorMessage = "[#ERROR CONVERTING ACIP DOCUMENT: The Unicode escape '" + ch + "' with ordinal " + (int)ch + " is in the private-use area (PUA) of Unicode and will thus not be written out into the output lest you think other tools will be able to understand this non-standard construction.]";
|
||||
writer.write(errorMessage);
|
||||
if (null != errors)
|
||||
errors.append(errorMessage + "\n");
|
||||
continue; // FIXME: dropping output if null != tdoc
|
||||
} else
|
||||
unicode = s.getText();
|
||||
}
|
||||
if (null != tdoc) {
|
||||
duff = TibetanMachineWeb.mapUnicodeToTMW(s.getText().charAt(0));
|
||||
|
|
|
@ -41,6 +41,7 @@ public class TString {
|
|||
* is to be converted to something other than Tibetan text.
|
||||
* (Chinese Unicode, Latin, etc. all qualify as non-Tibetan.) */
|
||||
public boolean isLatin() {
|
||||
char ch;
|
||||
return (type != TIBETAN_NON_PUNCTUATION
|
||||
&& type != TIBETAN_PUNCTUATION
|
||||
&& type != TSHEG_BAR_ADORNMENT
|
||||
|
@ -49,7 +50,10 @@ public class TString {
|
|||
&& type != START_SLASH
|
||||
&& type != END_SLASH
|
||||
&& (type != UNICODE_CHARACTER
|
||||
|| !UnicodeUtils.isInTibetanRange(getText().charAt(0))));
|
||||
|| !(UnicodeUtils.isInTibetanRange(ch = getText().charAt(0))
|
||||
// EWTS maps some TMW glyphs to this Unicode
|
||||
// private-use area (PUA):
|
||||
|| (ch >= '\uF021' && ch <= '\uF0FF'))));
|
||||
}
|
||||
|
||||
/** For ACIP [#COMMENTS] and EWTS (DLC FIXME: what are EWTS comments?) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue