Table of Contents
The CG-2 spec dictates that for a test
"There is a cohort to the left containing a reading which has a tag belonging to the set A.
The first such cohort must have a tag belonging to the set A in all its readings."
...meaning scanning stops at the first A regardless of whether it is carefully A.
To scan further than the first A you must use **.
VISLCG2 was not compliant with that and would scan until it found a "careful A".
This caused the need for ugly hacks such as
(*1C A BARRIER A) to emulate the correct behavior.
If you for whatever reason need to determine whether a cohort has readings with (un)ambiguous base forms, the following is how:
LIST bform = ".*"r ; # Determines ambiguous base forms ADD (@baseform-diff) $$bform (0 (*) - $$bform) ; # ...so NEGATE to determine unambigious base forms ADD (@baseform-same) $$bform (NEGATE 0 (*) - $$bform) ;
A final cleanup step of many dependency grammars is to attach anything that was not assigned a parent to the root of the window. This can be done easily with:
# For all cohorts that has no parent, attach to 0th cohort SETPARENT (*) (NEGATE p (*)) TO (@0 (*)) ;
The BARRIER and CBARRIER behavior may only refer to a single cohort, but often you want to stop because of a condition expressed in multiple cohorts. This can be solved in a flat manner via MAP, ADD, or SUBSTITUTE.
ADD (¤list) Noun (1 Comma) ; SELECT Noun (-1* Adj BARRIER (¤list)) ;
ADDCOHORT can be used to add any type of cohort, including delimiter ones. But it will not automatically delimit the window at such a cohort, so you need to add a DELIMIT rule after if that is your intended outcome. Just be mindful that DELIMIT will restart the grammar, so ADDCOHORT may fire again causing an endless loop; break it by conditioning ADDCOHORT, such as
ADDCOHORT ("§") AFTER (@title-end) IF (NOT 1 (<<<)) ; DELIMIT _S_DELIMITERS_ ; # Use the magic set that contains what DELIMITERS defined