diff --git a/source/org/thdl/tib/input/DuffPaneTest.java b/source/org/thdl/tib/input/DuffPaneTest.java index 760fafb..9a0183e 100644 --- a/source/org/thdl/tib/input/DuffPaneTest.java +++ b/source/org/thdl/tib/input/DuffPaneTest.java @@ -201,34 +201,33 @@ public class DuffPaneTest extends TestCase { ensureKeysGiveCorrectWylie("lasd", "lasda"); - ensureKeysGiveCorrectWylie("b.lar.d"); + ensureKeysGiveCorrectWylie("b.lar.d", "balarada"); ensureKeysGiveCorrectWylie("blar.d"); ensureKeysGiveCorrectWylie("blarad", "blar.d"); ensureKeysGiveCorrectWylie("b.lard", "balarda"); - ensureKeysGiveCorrectWylie("b.lal.d"); + ensureKeysGiveCorrectWylie("b.lal.d", "balalada"); ensureKeysGiveCorrectWylie("blald", "blalda"); ensureKeysGiveCorrectWylie("b.lald", "balalda"); - ensureKeysGiveCorrectWylie("b.las.d"); + ensureKeysGiveCorrectWylie("b.las.d", "balasada"); ensureKeysGiveCorrectWylie("blasd", "blasda"); ensureKeysGiveCorrectWylie("b.lasd", "balasda"); - ensureKeysGiveCorrectWylie("b.luHna"); + ensureKeysGiveCorrectWylie("b.luHna", "baluHna"); - ensureKeysGiveCorrectWylie("b.lA-iMg"); + ensureKeysGiveCorrectWylie("b.lA-iMg", "balA-iMga"); ensureKeysGiveCorrectWylie("blA-iMg"); - ensureKeysGiveCorrectWylie("b.lag"); - ensureKeysGiveCorrectWylie("blg", - "balga"); + ensureKeysGiveCorrectWylie("b.lag", "balaga"); + ensureKeysGiveCorrectWylie("blga"); ensureKeysGiveCorrectWylie("b.las", "bals"); @@ -237,7 +236,7 @@ public class DuffPaneTest extends TestCase { ensureKeysGiveCorrectWylie("bls", "bals"); - ensureKeysGiveCorrectWylie("b.rag"); + ensureKeysGiveCorrectWylie("b.rag", "baraga"); ensureKeysGiveCorrectWylie("brg", "brga"); @@ -311,7 +310,7 @@ public class DuffPaneTest extends TestCase { ensureKeysGiveCorrectWylie("'byungs"); - ensureKeysGiveCorrectWylie("b.lags"); + ensureKeysGiveCorrectWylie("b.lags", "balagasa"); ensureKeysGiveCorrectWylie("blags"); // DLC FIXME: add b-r-g-s, b-l-g-s, etc. diff --git a/source/org/thdl/tib/text/tshegbar/LegalTshegBar.java b/source/org/thdl/tib/text/tshegbar/LegalTshegBar.java index 1e53ad2..bdf5809 100644 --- a/source/org/thdl/tib/text/tshegbar/LegalTshegBar.java +++ b/source/org/thdl/tib/text/tshegbar/LegalTshegBar.java @@ -1270,16 +1270,16 @@ public final class LegalTshegBar if (EW_ABSENT == head) { if (EW_ABSENT == sub) { return (EWC_ca == root - || EWC_ta == root || EWC_da == root - || EWC_tsa == root - || EWC_zha == root - || EWC_za == root - || EWC_ya == root - || EWC_sha == root - || EWC_sa == root + || EWC_na == root || EWC_nya == root - || EWC_na == root); + || EWC_sa == root + || EWC_sha == root + || EWC_ta == root + || EWC_tsa == root + || EWC_ya == root + || EWC_za == root + || EWC_zha == root); } } return false; @@ -1301,23 +1301,26 @@ public final class LegalTshegBar public static boolean takesDao(char head, char root, char sub) { if (EW_ABSENT == head) { if (EW_ABSENT == sub) { - return (EWC_ka == root + return ( + EWC_ba == root || EWC_ga == root + || EWC_ka == root + || EWC_ma == root || EWC_nga == root || EWC_pa == root - || EWC_ba == root - || EWC_ma == root); + ); } else { - return ((EWC_ga == root && EWC_ya == sub) - || (EWC_pa == root && EWC_ya == sub) + return ( + (EWC_ba == root && EWC_ra == sub) || (EWC_ba == root && EWC_ya == sub) - || (EWC_ma == root && EWC_ya == sub) - || (EWC_ka == root && EWC_ya == sub) // dkyil, for example - - || (EWC_ka == root && EWC_ra == sub) || (EWC_ga == root && EWC_ra == sub) - || (EWC_ba == root && EWC_ra == sub) - || (EWC_pa == root && EWC_ra == sub)); + || (EWC_ga == root && EWC_ya == sub) + || (EWC_ka == root && EWC_ra == sub) + || (EWC_ka == root && EWC_ya == sub) // dkyil, for example + || (EWC_ma == root && EWC_ya == sub) + || (EWC_pa == root && EWC_ra == sub) + || (EWC_pa == root && EWC_ya == sub) + ); } } else { return false; @@ -1420,7 +1423,18 @@ public final class LegalTshegBar * nominal representation} of the subjoined letter, or EW_ABSENT * if not present */ public static boolean takesBao(char head, char root, char sub) { - // DLC ask Ten-lo la about Wazur. + + // Special cases: there are four rare, maybe archaic + // constructs for which I don't let the sub or lack of sub + // matter. Info is not complete here. I learned of these + // through personal correspondence with Robert Chilton. + if (EWC_la == head + && (EWC_ka == root + || EWC_ga == root + || EWC_nga == root + || EWC_ja == root)) + return true; + if (EW_ABSENT == head) { if (EW_ABSENT == sub) { return (EWC_ka == root @@ -1429,17 +1443,20 @@ public final class LegalTshegBar || EWC_ta == root || EWC_tsa == root || EWC_ga == root - || EWC_nga == root - || EWC_ja == root - || EWC_nya == root || EWC_da == root - || EWC_na == root - || EWC_dza == root || EWC_zha == root || EWC_za == root - || EWC_ra == root - || EWC_la == root - || EWC_sha == root); + || EWC_sha == root + + || (true && // DLC NOW: these are not in RC's non-definitive list. Thus, BNGA is B+NGA in ACIP transliteration. But that seems odd to me, so I'm seeing what RC thinks about these. + ( + EWC_nga == root + || EWC_ja == root + || EWC_nya == root + || EWC_na == root + || EWC_dza == root + ) + )); } else { // kra, e.g. return ((EWC_ka == root && EWC_ya == sub) diff --git a/source/org/thdl/tib/text/tshegbar/LegalTshegBarTest.java b/source/org/thdl/tib/text/tshegbar/LegalTshegBarTest.java index 88a7b01..b803301 100644 --- a/source/org/thdl/tib/text/tshegbar/LegalTshegBarTest.java +++ b/source/org/thdl/tib/text/tshegbar/LegalTshegBarTest.java @@ -302,10 +302,10 @@ public class LegalTshegBarTest extends TestCase implements UnicodeConstants { assertTrue(LegalTshegBar.takesBao(EW_ABSENT, EWC_sa, EWC_ra)); assertTrue(LegalTshegBar.takesBao(EW_ABSENT, EWC_ga, EWC_ra)); assertTrue(LegalTshegBar.takesBao(EWC_ra, EWC_ga, EWC_ya)); + assertTrue(LegalTshegBar.takesBao(EWC_la, EWC_nga, EW_ABSENT)); assertTrue(!LegalTshegBar.takesBao(EWC_ra, EWC_da, EWC_ya)); assertTrue(!LegalTshegBar.takesBao(EW_ABSENT, EWC_ba, EW_ABSENT)); - assertTrue(!LegalTshegBar.takesBao(EWC_la, EWC_nga, EW_ABSENT)); assertTrue(!LegalTshegBar.takesBao(EW_ABSENT, EWC_nga, EWC_ra)); } diff --git a/source/org/thdl/tib/text/ttt/PackageTest.java b/source/org/thdl/tib/text/ttt/PackageTest.java index 8b9fb79..74d20d8 100644 --- a/source/org/thdl/tib/text/ttt/PackageTest.java +++ b/source/org/thdl/tib/text/ttt/PackageTest.java @@ -429,6 +429,14 @@ tstHelper("KA'", "[(K . A), (' . )]", tstHelper("LE'UM", null, null, null, "{LE}{'U}{M}", -1); tstHelper("LE'U'IS", null, null, null, "{LE}{'U}{'I}{S}", -1); + tstHelper("LAM'OS", null, null, null, "{LA}{M}{'O}{S}", 2); + tstHelper("NAM'OS", null, null, null, "{NA}{M}{'O}{S}", 2); + tstHelper("NAM'IS", null, null, null, "{NA}{M}{'I}{S}", 2); + tstHelper("LEM'UNG", null, null, null, "{LE}{M}{'U}{NG}", 2); + tstHelper("LEM'U'ANG", null, null, null, "{LE}{M}{'U}{'A}{NG}", 2); + tstHelper("LEM'UM", null, null, null, "{LE}{M}{'U}{M}", 2); + tstHelper("LEM'U'IS", null, null, null, "{LE}{M}{'U}{'I}{S}", 2); + tstHelper("MA'ONGS", null, null, null, "{MA}{'O}{NG}{S}", -1); tstHelper("SAM'AM", null, null, null, "{SA}{M}{'A}{M}", 2); @@ -440,13 +448,20 @@ tstHelper("KA'", "[(K . A), (' . )]", tstHelper("SNYAM+S+'O", null, null, null, "{S+NYA}{M+S+'O}", -1); tstHelper("SNYAMS+'O", null, null, null, "{S+NYA}{M+S+'O}", -1); - tstHelper("GDAMS", null, null, null, "{G}{DA}{M}{S}", -1); + { + // Tests this rule: if a stack X takes a prefix Y, then X with + // wa-zur takes the prefix Y also. + tstHelper("GDAMS", null, null, null, "{G}{DA}{M}{S}", -1); + tstHelper("GDVAMS", null, null, null, "{G}{D+VA}{M}{S}", -1); + } + tstHelper("GDAM-S'O", null, null, null, "{G}{DA}{M}{S}{'O}", 2); tstHelper("GDAM-C'O", null, null, null, "{G+DA}{M}{C'O}", 0); tstHelper("GDAM-C'O", null, null, null, "{G+DA}{M}{C}{'O}", 3); - // DLC NOW: FIXME: tstHelper("DKHY", null, null, null, "{D}{KH+YA}", 0); - // DLC DKHY'O should give parse tree {{D-KH+Y'O}, {D+KH+Y'O}} - // DLC DKHYA'O should give parse tree {{D-KH+YA'O}, {D+KH+YA'O}} + tstHelper("BRLA", null, null, null, "{B}{R+LA}", -1); + tstHelper("DKY", null, null, null, "{D}{K+Y}", -1); + // DLC FIXME NOW this should work, but doesn't: tstHelper("DKY'O", null, null, null, "{D}{K+Y'O}", 3); + tstHelper("DKYA'O", null, null, null, "{D}{K+YA}{'O}", -1); tstHelper("SHR'I", "{SH}{R'I}", null,