Chapter 13. Making use of Relations

Table of Contents

ADDRELATION, ADDRELATIONS
SETRELATION, SETRELATIONS
REMRELATION, REMRELATIONS
Existing Relations in Input
Contextual Tests
Specific Relation
Any Relation
Self
Left/right of, Left/rightmost
All Scan
None Scan

CG-3 can also work with generic relations. These are analogous to dependency relations, but can have any name, overlap, are directional, and can point to multiple cohorts.

ADDRELATION, ADDRELATIONS

      [wordform] ADDRELATION <name> <target> [contextual_tests]
          TO|FROM <contextual_target> [contextual_tests] ;
      [wordform] ADDRELATIONS <name> <name> <target> [contextual_tests]
          TO|FROM <contextual_target> [contextual_tests] ;
    

ADDRELATION creates a one-way named relation from the current cohort to the found cohort. The name must be an alphanumeric string with no whitespace.

      ADDRELATION (name) targetset (-1* ("someword"))
        TO (1* (@candidate)) (2 SomeSet) ;
    

ADDRELATIONS creates two one-way named relation; one from the current cohort to the found cohort, and one the other way. The names can be the same if so desired.

      ADDRELATIONS (name) (name) targetset (-1* ("someword"))
        TO (1* (@candidate)) (2 SomeSet) ;
    

SETRELATION, SETRELATIONS

      [wordform] SETRELATION <name> <target> [contextual_tests]
          TO|FROM <contextual_target> [contextual_tests] ;
      [wordform] SETRELATIONS <name> <name> <target> [contextual_tests]
          TO|FROM <contextual_target> [contextual_tests] ;
    

SETRELATION removes all previous relations with the name, then creates a one-way named relation from the current cohort to the found cohort. The name must be an alphanumeric string with no whitespace.

      SETRELATION (name) targetset (-1* ("someword"))
        TO (1* (@candidate)) (2 SomeSet) ;
    

SETRELATIONS removes all previous relations in the respective cohorts with the respective names, then creates two one-way named relation; one from the current cohort to the found cohort, and one the other way. The names can be the same if so desired.

      SETRELATIONS (name) (name) targetset (-1* ("someword"))
        TO (1* (@candidate)) (2 SomeSet) ;
    

REMRELATION, REMRELATIONS

      [wordform] REMRELATION <name> <target> [contextual_tests]
          TO|FROM <contextual_target> [contextual_tests] ;
      [wordform] REMRELATIONS <name> <name> <target> [contextual_tests]
          TO|FROM <contextual_target> [contextual_tests] ;
    

REMRELATION destroys one direction of a relation previously created with either ADDRELATION or SETRELATION.

      REMRELATION (name) targetset (-1* ("someword"))
        TO (1* (@candidate)) (2 SomeSet) ;
    

REMRELATIONS destroys both directions of a relation previously created with either ADDRELATION or SETRELATION.

      REMRELATIONS (name) (name) targetset (-1* ("someword"))
        TO (1* (@candidate)) (2 SomeSet) ;
    

Existing Relations in Input

Relational attachments are in the forms of ID:id and R:name:id tags. The ID tags are assumed to give the cohort a globally unique numeric ID, and this number is what the id from R tags refer to. The name part must be alphanumeric and must not start with a number.

It is normal for ID tags to exist without R tags for one-way relations, but any line with an R tag must have its ID along.

For example:

        "<There>"
          "there" <*> ADV @F-SUBJ ID:1056
        "<once>"
          "once" ADV @ADVL
        "<was>"
          "be" <SVC/N> <SVC/A> V PAST SG1/3 VFIN IMP @FMV
        "<a>"
          "a" <Indef> ART DET CENTRAL SG @>N
        "<man>"
          "man" N NOM SG @SC ID:1060 R:Beginning:1056
        "<$.>"
      

Contextual Tests

Once you have relations to work with, you can use that in subsequent contextual tests as seen below. These positions can be combined with the window spanning options.

Specific Relation

The 'r:rel' position asks for cohorts found via the 'rel' relation. 'rel' can be any name previously given via ADDRELATION or SETRELATION. Be aware that for combining positional options, 'r:rel' should be the last in the position; 'r:' will eat anything following it until it meets a space.

        (r:rel (ADJ))
      

Any Relation

The 'r:*' position asks for cohorts found via any relation.

        (r:* (ADJ))
      

Self

The 'S' option allows the test to look at the current target as well. Used in conjunction with p, c, cc, s, or r to test self and the relations.

        (Sr:rel (ADJ))
      

Left/right of, Left/rightmost

The r, l, rr, ll, rrr, lll, rrl, llr options documented at Dependencies also work for Relations.

        (rrrr:rel (ADJ))
        (lr:rel (ADJ))
      

All Scan

The 'ALL' option will require that all of the relations match the set. For example, position 'ALL r:rel' requires that all of the 'rel' relations match the set.

        (ALL r:rel (ADJ))
      

None Scan

The 'NONE' option will require that none of the relations match the set. For example, position 'NONE r:rel' requires that none of the 'rel' relations match the set.

        (NONE r:rel (ADJ))