// Let's make sure that no unknown code is used during
// development:
ThdlDebug.verify("unknown code "+code,
null!=severityMap.get(newInteger(code)));
if(shortMessages){
if("(".equals(translit)
||")".equals(translit)
||"{".equals(translit)
||"}".equals(translit)
||"[".equals(translit)
||"]".equals(translit)
||"<".equals(translit)
||">".equals(translit))
return""+code+": '"+translit+"'";
else
return""+code+": {"+translit+"}";
}
// else:
switch(code){
// ERRORS:
case101:
return""+code+": There's not even a unique, non-illegal parse for {"+translit+"}";
case102:
return""+code+": Found an open bracket, '"+translit+"', within a [#COMMENT]-style comment. Brackets may not appear in comments.";
case103:
return""+code+": Found a truly unmatched close bracket, '"+translit+"'.";
case104:
return""+code+": Found a closing bracket, '"+translit+"', without a matching open bracket. Perhaps a [#COMMENT] incorrectly written as [COMMENT], or a [*CORRECTION] written incorrectly as [CORRECTION], caused this.";
case105:
return""+code+": Found a truly unmatched open bracket, '[' or '{', prior to this current illegal open bracket, '"+translit+"'.";
case106:
return""+code+": Found an illegal open bracket (in context, this is '"+translit+"'). Perhaps there is a [#COMMENT] written incorrectly as [COMMENT], or a [*CORRECTION] written incorrectly as [CORRECTION], or an unmatched open bracket?";
case107:
return""+code+": Found an illegal at sign, @ (in context, this is "+translit+"). This folio marker has a period, '.', at the end of it, which is illegal.";
case108:
return""+code+": Found an illegal at sign, @ (in context, this is "+translit+"). This folio marker is not followed by whitespace, as is expected.";
case109:
return""+code+": Found an illegal at sign, @ (in context, this is "+translit+"). @012B is an example of a legal folio marker.";
case110:
/*
//NYA\\ appears in ACIP input, and I think it means
/////NYA/. We warn about // for this reason. \\ causes
atsheg-bar//error.
*/
return""+code+": Found //, which could be legal (the Unicode would be \\u0F3C\\u0F3D), but is likely in an illegal construct like //NYA\\\\.";
case111:
return""+code+": Found an illegal open parenthesis, '('. Nesting of parentheses is not allowed.";
return""+code+": The ACIP {?}, found alone, may intend U+0F08, but it may intend a question mark, i.e. '?', in the output. It may even mean that the original text could not be deciphered with certainty, like the ACIP {[?]} does.";
case114:
return""+code+": Found an illegal, unprintable character.";
case115:
return""+code+": Found a backslash, \\, which the ACIP Tibetan Input Code standard says represents a Sanskrit virama. In practice, though, this is so often misused (to represent U+0F3D) that {\\} always generates this error. If you want a Sanskrit virama, change the input document to use {\\u0F84} instead of {\\}. If you want U+0F3D, use {/NYA/} or {/NYA\\u0F3D}.";
case116:
ThdlDebug.verify(translit.length()==1);
return""+code+": Found an illegal character, '"+translit+"', with ordinal (in decimal) "+(int)translit.charAt(0)+".";
case117:
return""+code+": Unexpected end of input; truly unmatched open bracket found.";
case118:
return""+code+": Unmatched open bracket found. A comment does not terminate.";
case119:
return""+code+": Unmatched open bracket found. A correction does not terminate.";
case120:
return""+code+": Slashes are supposed to occur in pairs, but the input had an unmatched '/' character.";
case121:
return""+code+": Parentheses are supposed to occur in pairs, but the input had an unmatched parenthesis, '('.";
case122:
return""+code+": Warning, empty tsheg bar found while converting from ACIP!";
case123:
return""+code+": Cannot convert ACIP {"+translit+"} because it contains a number but also a non-number.";
case124:
return""+code+": Cannot convert ACIP {"+translit+"} because {V}, wa-zur, appears without being subscribed to a consonant.";
case125:
return""+code+": Cannot convert ACIP {"+translit+"} because we would be required to assume that {A} is a consonant, when it is not clear if it is a consonant or a vowel.";
case126:
return""+code+": Cannot convert ACIP {"+translit+"} because it ends with a '+'.";
case127:
return""+code+": Cannot convert ACIP {"+translit+"} because it ends with a '-'.";
case128:// fall through
case129:
thrownewError("No; error messages 128 and 129 are handled elsewhere.");
case130:
return""+code+": The tsheg bar (\"syllable\") {"+translit+"} is essentially nothing.";
case131:
return""+code+": The ACIP caret, {^}, must precede a tsheg bar.";
case132:
return""+code+": The ACIP {"+translit+"} must be glued to the end of a tsheg bar, but this one was not.";
case133:
return""+code+": Cannot convert the ACIP {"+translit+"} to Tibetan because it is unclear what the result should be.";
case134:
return""+code+": The tsheg bar (\"syllable\") {"+translit+"} has no legal parses.";
case135:
ThdlDebug.verify(translit.length()==1);
return""+code+": The Unicode escape '"+translit+"' with ordinal (in decimal) "+(int)translit.charAt(0)+" is specified by the Extended Wylie Transliteration Scheme (EWTS), but 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.";
case136:
ThdlDebug.verify(translit.length()==1);
return""+code+": The Unicode escape with ordinal (in decimal) "+(int)translit.charAt(0)+" does not match up with any TibetanMachineWeb glyph.";
// See 137 below.
case138:
ThdlDebug.verify(translit.length()==1);
return""+code+": The Unicode escape '"+translit+"' with ordinal (in decimal) "+(int)translit.charAt(0)+" is in the Tibetan range of Unicode (i.e., [U+0F00, U+0FFF]), but is a reserved code in that area.";
// WARNINGS (by default):
case501:
thrownewError("Nah -- we handle this one in the code because the message is complicated for 501");
case502:
return""+code+": The last stack does not have a vowel in {"+translit+"}; this may indicate a typo, because Sanskrit, which this probably is (because it's not legal Tibetan), should have a vowel after each stack.";
case503:
return""+code+": Though {"+translit+"} is unambiguous, it would be more computer-friendly if '+' signs were used to stack things because there are two (or more) ways to interpret this ACIP if you're not careful.";
case504:
return""+code+": The ACIP {"+translit+"} is treated by this converter as U+0F35, but sometimes might represent U+0F14 in practice. To avoid seeing this warning again, change the input to use {\\u0F35} instead of {"+translit+"}.";
case505:
return""+code+": There is a useless disambiguator in {"+translit+"}.";
case506:
return""+code+": There is a stack of three or more consonants in {"+translit+"} that uses at least one '+' but does not use a '+' between each consonant.";
case507:
return""+code+": There is a chance that the ACIP {"+translit+"} was intended to represent more consonants than we parsed it as representing -- NNYA, e.g., means N+NYA, but you can imagine seeing N+N+YA and typing NNYA for it too.";
case508:// see 509 also
return""+code+": The ACIP {"+translit+"} has been interpreted as two stacks, not one, but you may wish to confirm that the original text had two stacks as it would be an easy mistake to make to see one stack (because there is such a stack used in Sanskrit transliteration for this particular sequence) and forget to input it with '+' characters.";
case509:// see 508 also
return""+code+": The ACIP {"+translit+"} has an initial sequence that has been interpreted as two stacks, a prefix and a root stack, not one nonnative stack, but you may wish to confirm that the original text had two stacks as it would be an easy mistake to make to see one stack (because there is such a stack used in Sanskrit transliteration for this particular sequence) and forget to input it with '+' characters.";
case510:
return""+code+": A non-breaking tsheg, '"+translit+"', appeared, but not like \"...,\" or \".,\" or \".dA\" or \".DA\".";
// ERROR 137 and WARNING 511 are the same:
case137:/* fall through */
case511:
return""+code+": The ACIP {"+translit+"} cannot be represented with the TibetanMachine or TibetanMachineWeb fonts because no such glyph exists in these fonts.";
// NEVER HAPPENS:
default:
ThdlDebug.verify("switch statement is missing a case",
false);
return"unknown error or warning with number "+code;
out.println("ACIP->Tibetan ERRORS are as follows, and appear in their short forms, embedded");
out.println("in the output, like [#ERROR 130: {X}]:");
out.println("");
for(intnum=MIN_ERROR;num<=MAX_ERROR;num++){
if(128==num){
out.println("128: Cannot convert ACIP {"+translit+"} because "+"A:"+" is a \"vowel\" without an associated consonant.");
}elseif(129==num){
out.println("129: Cannot convert ACIP {"+translit+"} because "+"+"+" is not an ACIP consonant.");
}else{
out.println(getMessage(num,false,translit));
}
out.println("");
}
out.println("ACIP->Tibetan WARNINGS are as follows, and appear in their short forms, embedded");
out.println("in the output, like [#WARNING 510: {X}]:");
out.println("");
for(intnum=MIN_WARNING;num<=MAX_WARNING;num++){
if(501==num){
out.println("501: Using "+translit+", but only because the tool's knowledge of prefix rules (see the documentation) says that "+"XX"+" is not a legal Tibetan tsheg bar (\"syllable\")");