Tremendously better EWTS->Unicode and EWTS->TMW conversion, though still not tested end-to-end and without perfect unit tests. See EWTSTest.RUN_FAILING_TESTS, for example, to find imperfection.
This commit is contained in:
parent
affb9e4b5e
commit
0b3a636f63
20 changed files with 797 additions and 350 deletions
|
@ -163,14 +163,15 @@ class TPair {
|
|||
}
|
||||
|
||||
/** Returns a 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 on the
|
||||
* right. May return itself (but never mutates this
|
||||
* instance). */
|
||||
* "+" on the right if this pair is empty on the right and, when
|
||||
* appropriate, is empty on the right if this pair has a
|
||||
* disambiguator on the right. May return itself (but never
|
||||
* mutates this instance). */
|
||||
TPair insideStack() {
|
||||
if (null == getRight())
|
||||
return new TPair(traits, getLeft(), "+");
|
||||
else if (traits.disambiguator().equals(getRight()))
|
||||
else if (traits.disambiguator().equals(getRight())
|
||||
&& !traits.stackingMustBeExplicit())
|
||||
return new TPair(traits, getLeft(), null);
|
||||
else
|
||||
return this;
|
||||
|
@ -248,11 +249,18 @@ class TPair {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(DLC)[EWTS->Tibetan]
|
||||
/** 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()));
|
||||
/** For ACIP: Returns true if this pair is surely the last pair in
|
||||
* an ACIP stack. Stacking continues through (* . ) and (* . +),
|
||||
* but stops anywhere else.
|
||||
*
|
||||
* <p>For EWTS: Returns true if this pair is probably the last
|
||||
* pair in an EWTS stack. For natives stacks like that found in
|
||||
* [bra], this is not really true. */
|
||||
boolean endsStack() {
|
||||
final boolean explicitlyStacks = "+".equals(getRight());
|
||||
if (!traits.stackingMustBeExplicit())
|
||||
return (getRight() != null && !explicitlyStacks);
|
||||
else
|
||||
return (!explicitlyStacks);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue