Added more test cases.

This commit is contained in:
dchandler 2003-10-21 02:14:45 +00:00
parent 2f81a801ef
commit 2f39921381
2 changed files with 19 additions and 9 deletions

View file

@ -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");

View file

@ -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,