diff --git a/source/org/thdl/tib/text/ttt/PackageTest.java b/source/org/thdl/tib/text/ttt/PackageTest.java index 2632f44..9cceea7 100644 --- a/source/org/thdl/tib/text/ttt/PackageTest.java +++ b/source/org/thdl/tib/text/ttt/PackageTest.java @@ -386,6 +386,14 @@ tstHelper("KA'", "[(K . A), (' . )]", new String[] { "{B}{DE}" }, "{B}{DE}"); + tstHelper("NA+YA", "{N+}{YA}", + new String[] { "{N+YA}" }, + new String[] { "{N+YA}" }, + "{N+YA}"); + + tstHelper("NE+YA", "{NE}{+-}{YA}", + null, null, "!null!"); + tstHelper("GDAMS'O", "{G}{DA}{M}{S'O}", new String[] { "{G+DA}{M+S'O}", @@ -7364,6 +7372,8 @@ tstHelper("ZUR"); } public void testACIPConversion() { + uhelp("NA+YA", "\u0f53\u0fb1"); // DLC FIXME: warn about the extra A + uhelp("NE+YA", "[#ERROR CONVERTING ACIP DOCUMENT: THE TSHEG BAR (\"SYLLABLE\") NE+YA HAS THESE ERRORS: Cannot convert ACIP NE+-YA because + is not an ACIP consonant]"); uhelp("tRAStA", "\u0f4a\u0fb2\u0f66\u0f9a"); uhelp("DZHDZHA", "[#WARNING CONVERTING ACIP DOCUMENT: There is a chance that the ACIP DZHDZHA 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.]\u0f5c\u0fac"); // tricky because DZHDZA is not in TMW but DZHDZHA is uhelp("DZHDZA", "[#WARNING CONVERTING ACIP DOCUMENT: There is a chance that the ACIP DZHDZA 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.]\u0f5c\u0fab"); diff --git a/source/org/thdl/tib/text/ttt/TPairListFactory.java b/source/org/thdl/tib/text/ttt/TPairListFactory.java index 09b14e3..ef149d4 100644 --- a/source/org/thdl/tib/text/ttt/TPairListFactory.java +++ b/source/org/thdl/tib/text/ttt/TPairListFactory.java @@ -153,17 +153,17 @@ class TPairListFactory { return tail; } - /** Returns the largest TPair we can make from the acip - * starting from the left. This will return a size zero pair if - * and only if acip is the empty string; otherwise, it may return - * a pair with either the left or right component empty. This - * mutates acip when we run into {NA+YA}; it mutates acip into - * {N+YA}. For {NE+YA}, it doesn not mutate acip or behave - * intelligently. A later phase will need to turn that into - * {N+YE} (DLC). howMuch[0] will be set to the number of + /** Returns the largest TPair we can make from the acip starting + * from the left. This will return a size zero pair if and only + * if acip is the empty string; otherwise, it may return a pair + * with either the left or right component empty. This mutates + * acip when we run into {NA+YA}; it mutates acip into {N+YA}. + * For {NE+YA}, it does not mutate acip or behave intelligently. + * A later phase will need to turn that into {N+YE} or an error + * or whatever you like. howMuch[0] will be set to the number of * characters of acip that this call has consumed. */ private static TPair getFirstConsonantAndVowel(StringBuffer acip, - int howMuch[]) { + int howMuch[]) { // Note that it is *not* the case that if acip.substring(0, N) // is legal (according to TPair.isLegal()), then // acip.substring(0, N-1) is legal for all N. For example,