New Feature: MergeCohorts

11 views
Skip to first unread message

Tino Didriksen

unread,
Sep 7, 2018, 3:09:01 AM9/7/18
to Constraint Grammar
New rule type: MergeCohorts
Documentation: https://visl.sdu.dk/cg3/chunked/rules.html#mergecohorts

This feature has been asked for since at least Nov 2013 ( https://groups.google.com/d/msg/constraint-grammar/qXStKY2qpEM/DG8tuCsKjoEJ ), and yesterday I finally implemented a first version of it.


E.g., given input
"<March>"
    "March" month
"<2nd>"
    "2nd" ordinal

The rule
    MergeCohorts ("<$1 $2>"v "$1 $2"v date) ("<(.+)>"r month) WITH (1 ("<(.+)>"r ordinal)) ;

would yield
"<March 2nd>"
    "March 2nd" date


It does not yet handle dependencies or named relations. One would assume you'd only ever merge inter-dependent cohorts, in which case the dependencies are trivial to solve - just have the new cohort take the place of the removed cohorts. But when that's not true, it gets complicated.

-- Tino Didriksen

Tino Didriksen

unread,
Sep 7, 2018, 7:30:12 AM9/7/18
to Constraint Grammar
And first update already: In the cohort recipe, * now means copy all the target cohort's tags to this spot.

-- Tino Didriksen
Reply all
Reply to author
Forward
0 new messages