ACIP now stacks greedily. TTTTTA is T+T+T+T+TA, even though that stack doesn't exist in TM or TMW. Robert Chilton, in personal correspondence, agreed that this is the way to do things.

ACIP handles the appendages 'AM, 'ANG, 'US, 'UR, 'I, 'O, and 'U correctly.
This commit is contained in:
dchandler 2003-10-16 04:15:10 +00:00
parent 5f4fbfab7c
commit 5e18feb47d
10 changed files with 576 additions and 348 deletions

View file

@ -118,7 +118,7 @@ class TPair {
return (null != l
&& ((null == r || "".equals(r))
|| "-".equals(r)
|| "A".equals(r)) // DLC though check for BASKYABS and warn because BSKYABS is more common
|| "A".equals(r)) // DLC FIXME: though check for BASKYABS and warn because BSKYABS is more common
&& ("'".equals(l)
|| "M".equals(l)
|| "B".equals(l)
@ -126,12 +126,52 @@ class TPair {
|| "G".equals(l)));
}
/** Returns true if and only if this pair could be a Tibetan
* secondary sufffix. */
boolean isPostSuffix() {
return (null != l
&& ((null == r || "".equals(r))
|| "-".equals(r)
|| "A".equals(r)) // DLC FIXME: though warn about GAMASA vs. GAMS
&& ("S".equals(l)
|| "D".equals(l)));
}
/** Returns true if and only if this pair could be a Tibetan
* sufffix. DLC FIXME: ACIP specific, just like isPostSuffix() and isPrefix() */
boolean isSuffix() {
return (null != l
&& ((null == r || "".equals(r))
|| "-".equals(r)
|| "A".equals(r))
&& ("S".equals(l)
|| "G".equals(l)
|| "D".equals(l)
|| "M".equals(l)
|| "'".equals(l)
|| "B".equals(l)
|| "NG".equals(l)
|| "N".equals(l)
|| "L".equals(l)
|| "R".equals(l)));
}
/** Returns true if and only if this pair is merely a
* disambiguator. */
boolean isDisambiguator() {
return ("-".equals(r) && getLeft() == null);
}
/** Yep, this works for TPairs. */
public boolean equals(Object x) {
if (x instanceof TPair) {
TPair p = (TPair)x;
return ((getLeft() == p.getLeft() || (getLeft() != null && getLeft().equals(p.getLeft())))
|| (getRight() == p.getRight() || (getRight() != null && getRight().equals(p.getRight()))));
}
return false;
}
/** Returns an TPair that is like this pair except that it has
* a "+" on the right if this pair is empty on the right and is
* empty on the right if this pair has a disambiguator (i.e., a
@ -195,4 +235,11 @@ class TPair {
if (null != x) sb.append(x);
}
}
/** Returns true if this pair is surely the last pair in an ACIP
* stack. Stacking continues through (* . ) and (* . +), but
* stops anywhere else. */
boolean endsACIPStack() {
return (getRight() != null && !"+".equals(getRight()));
}
}