| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE chapter SYSTEM "docbook-dtd-45/docbookx.dtd"> |
| 3 |
|
| 4 |
<chapter id="relations"> |
| 5 |
<title>Making use of Relations</title> |
| 6 |
|
| 7 |
<para> |
| 8 |
CG-3 can also work with generic relations. These are analogous to dependency relations, |
| 9 |
but can have any name, overlap, are directional, and can point to multiple cohorts. |
| 10 |
</para> |
| 11 |
|
| 12 |
<section id="rel-addrelation"> |
| 13 |
<title>ADDRELATION, ADDRELATIONS</title> |
| 14 |
<indexterm> |
| 15 |
<primary>ADDRELATION</primary> |
| 16 |
</indexterm> |
| 17 |
<indexterm> |
| 18 |
<primary>ADDRELATIONS</primary> |
| 19 |
</indexterm> |
| 20 |
<screen> |
| 21 |
[wordform] ADDRELATION <name> <target> [contextual_tests] |
| 22 |
TO|FROM <contextual_target> [contextual_tests] ; |
| 23 |
[wordform] ADDRELATIONS <name> <name> <target> [contextual_tests] |
| 24 |
TO|FROM <contextual_target> [contextual_tests] ; |
| 25 |
</screen> |
| 26 |
<para> |
| 27 |
ADDRELATION creates a one-way named relation from the current cohort to the found cohort. |
| 28 |
The name must be an alphanumeric string with no whitespace. |
| 29 |
</para> |
| 30 |
<screen> |
| 31 |
ADDRELATION (name) targetset (-1* ("someword")) |
| 32 |
TO (1* (@candidate)) (2 SomeSet) ; |
| 33 |
</screen> |
| 34 |
<para> |
| 35 |
ADDRELATIONS creates two one-way named relation; one from the current cohort to the found cohort, |
| 36 |
and one the other way. The names can be the same if so desired. |
| 37 |
</para> |
| 38 |
<screen> |
| 39 |
ADDRELATIONS (name) (name) targetset (-1* ("someword")) |
| 40 |
TO (1* (@candidate)) (2 SomeSet) ; |
| 41 |
</screen> |
| 42 |
</section> |
| 43 |
|
| 44 |
<section id="rel-setrelation"> |
| 45 |
<title>SETRELATION, SETRELATIONS</title> |
| 46 |
<indexterm> |
| 47 |
<primary>SETRELATION</primary> |
| 48 |
</indexterm> |
| 49 |
<indexterm> |
| 50 |
<primary>SETRELATIONS</primary> |
| 51 |
</indexterm> |
| 52 |
<screen> |
| 53 |
[wordform] SETRELATION <name> <target> [contextual_tests] |
| 54 |
TO|FROM <contextual_target> [contextual_tests] ; |
| 55 |
[wordform] SETRELATIONS <name> <name> <target> [contextual_tests] |
| 56 |
TO|FROM <contextual_target> [contextual_tests] ; |
| 57 |
</screen> |
| 58 |
<para> |
| 59 |
SETRELATION removes all previous relations with the name, |
| 60 |
then creates a one-way named relation from the current cohort to the found cohort. |
| 61 |
The name must be an alphanumeric string with no whitespace. |
| 62 |
</para> |
| 63 |
<screen> |
| 64 |
SETRELATION (name) targetset (-1* ("someword")) |
| 65 |
TO (1* (@candidate)) (2 SomeSet) ; |
| 66 |
</screen> |
| 67 |
<para> |
| 68 |
SETRELATIONS removes all previous relations in the respective cohorts with the respective names, |
| 69 |
then creates two one-way named relation; one from the current cohort to the found cohort, |
| 70 |
and one the other way. The names can be the same if so desired. |
| 71 |
</para> |
| 72 |
<screen> |
| 73 |
SETRELATIONS (name) (name) targetset (-1* ("someword")) |
| 74 |
TO (1* (@candidate)) (2 SomeSet) ; |
| 75 |
</screen> |
| 76 |
</section> |
| 77 |
|
| 78 |
<section id="rel-remrelation"> |
| 79 |
<title>REMRELATION, REMRELATIONS</title> |
| 80 |
<indexterm> |
| 81 |
<primary>REMRELATION</primary> |
| 82 |
</indexterm> |
| 83 |
<indexterm> |
| 84 |
<primary>REMRELATIONS</primary> |
| 85 |
</indexterm> |
| 86 |
<screen> |
| 87 |
[wordform] REMRELATION <name> <target> [contextual_tests] |
| 88 |
TO|FROM <contextual_target> [contextual_tests] ; |
| 89 |
[wordform] REMRELATIONS <name> <name> <target> [contextual_tests] |
| 90 |
TO|FROM <contextual_target> [contextual_tests] ; |
| 91 |
</screen> |
| 92 |
<para> |
| 93 |
REMRELATION destroys one direction of a relation previously created with either |
| 94 |
<link linkend="rel-addrelation">ADDRELATION</link> or <link linkend="rel-setrelation">SETRELATION</link>. |
| 95 |
</para> |
| 96 |
<screen> |
| 97 |
REMRELATION (name) targetset (-1* ("someword")) |
| 98 |
TO (1* (@candidate)) (2 SomeSet) ; |
| 99 |
</screen> |
| 100 |
<para> |
| 101 |
REMRELATIONS destroys both directions of a relation previously created with either |
| 102 |
<link linkend="rel-addrelation">ADDRELATION</link> or <link linkend="rel-setrelation">SETRELATION</link>. |
| 103 |
</para> |
| 104 |
<screen> |
| 105 |
REMRELATIONS (name) (name) targetset (-1* ("someword")) |
| 106 |
TO (1* (@candidate)) (2 SomeSet) ; |
| 107 |
</screen> |
| 108 |
</section> |
| 109 |
|
| 110 |
<section id="rel-input"> |
| 111 |
<title>Existing Relations in Input</title> |
| 112 |
<para> |
| 113 |
Relational attachments are in the forms of ID:id and R:name:id tags. The ID tags are assumed to give the cohort |
| 114 |
a globally unique numeric ID, and this number is what the id from R tags refer to. The name part must be |
| 115 |
alphanumeric and must not start with a number. |
| 116 |
</para> |
| 117 |
<para> |
| 118 |
It is normal for ID tags to exist without R tags for one-way relations, |
| 119 |
but any line with an R tag must have its ID along. |
| 120 |
</para> |
| 121 |
<para> |
| 122 |
For example: |
| 123 |
<screen> |
| 124 |
"<There>" |
| 125 |
"there" <*> ADV @F-SUBJ ID:1056 |
| 126 |
"<once>" |
| 127 |
"once" ADV @ADVL |
| 128 |
"<was>" |
| 129 |
"be" <SVC/N> <SVC/A> V PAST SG1/3 VFIN IMP @FMV |
| 130 |
"<a>" |
| 131 |
"a" <Indef> ART DET CENTRAL SG @>N |
| 132 |
"<man>" |
| 133 |
"man" N NOM SG @SC ID:1060 R:Beginning:1056 |
| 134 |
"<$.>" |
| 135 |
</screen> |
| 136 |
</para> |
| 137 |
</section> |
| 138 |
|
| 139 |
<section id="rel-contextual-tests"> |
| 140 |
<title>Contextual Tests</title> |
| 141 |
<para> |
| 142 |
Once you have relations to work with, |
| 143 |
you can use that in subsequent contextual tests as seen below. |
| 144 |
These positions can be combined with the window spanning options. |
| 145 |
</para> |
| 146 |
|
| 147 |
<section id="rel-ct-specific"> |
| 148 |
<title>Specific Relation</title> |
| 149 |
<indexterm> |
| 150 |
<primary>r:rel</primary> |
| 151 |
</indexterm> |
| 152 |
<para> |
| 153 |
The 'r:rel' position asks for cohorts found via the 'rel' relation. |
| 154 |
'rel' can be any name previously given via |
| 155 |
<link linkend="rel-addrelation">ADDRELATION</link> or <link linkend="rel-setrelation">SETRELATION</link>. |
| 156 |
Be aware that for combining positional options, 'r:rel' should be the last in the position; |
| 157 |
'r:' will eat anything following it until it meets a space. |
| 158 |
</para> |
| 159 |
<screen> |
| 160 |
(r:rel (ADJ)) |
| 161 |
</screen> |
| 162 |
</section> |
| 163 |
|
| 164 |
<section id="rel-ct-any"> |
| 165 |
<title>Any Relation</title> |
| 166 |
<indexterm> |
| 167 |
<primary>r:*</primary> |
| 168 |
</indexterm> |
| 169 |
<para> |
| 170 |
The 'r:*' position asks for cohorts found via any relation. |
| 171 |
</para> |
| 172 |
<screen> |
| 173 |
(r:* (ADJ)) |
| 174 |
</screen> |
| 175 |
</section> |
| 176 |
|
| 177 |
<section id="rel-ct-self"> |
| 178 |
<title>Self</title> |
| 179 |
<indexterm> |
| 180 |
<primary>S</primary> |
| 181 |
</indexterm> |
| 182 |
<para> |
| 183 |
The 'S' option allows the test to look at the current target as well. |
| 184 |
Used in conjunction with p, c, cc, s, or r to test self and the relations. |
| 185 |
</para> |
| 186 |
<screen> |
| 187 |
(Sr:rel (ADJ)) |
| 188 |
</screen> |
| 189 |
</section> |
| 190 |
|
| 191 |
<section id="rel-ct-leftright"> |
| 192 |
<title>Left/right of, Left/rightmost</title> |
| 193 |
<indexterm> |
| 194 |
<primary>l</primary> |
| 195 |
</indexterm> |
| 196 |
<indexterm> |
| 197 |
<primary>r</primary> |
| 198 |
</indexterm> |
| 199 |
<indexterm> |
| 200 |
<primary>ll</primary> |
| 201 |
</indexterm> |
| 202 |
<indexterm> |
| 203 |
<primary>rr</primary> |
| 204 |
</indexterm> |
| 205 |
<indexterm> |
| 206 |
<primary>lll</primary> |
| 207 |
</indexterm> |
| 208 |
<indexterm> |
| 209 |
<primary>rrr</primary> |
| 210 |
</indexterm> |
| 211 |
<indexterm> |
| 212 |
<primary>llr</primary> |
| 213 |
</indexterm> |
| 214 |
<indexterm> |
| 215 |
<primary>rrl</primary> |
| 216 |
</indexterm> |
| 217 |
<para> |
| 218 |
The <link linkend="dep-ct-leftof">r, l, rr, ll, rrr, lll, rrl, llr options</link> |
| 219 |
documented at Dependencies also work for Relations. |
| 220 |
</para> |
| 221 |
<screen> |
| 222 |
(rrrr:rel (ADJ)) |
| 223 |
(lr:rel (ADJ)) |
| 224 |
</screen> |
| 225 |
</section> |
| 226 |
|
| 227 |
<section id="rel-ct-all"> |
| 228 |
<title>All Scan</title> |
| 229 |
<indexterm> |
| 230 |
<primary>ALL</primary> |
| 231 |
</indexterm> |
| 232 |
<para> |
| 233 |
The 'ALL' option will require that all of the relations match the set. |
| 234 |
For example, position 'ALL r:rel' requires that all of the 'rel' relations match the set. |
| 235 |
</para> |
| 236 |
<screen> |
| 237 |
(ALL r:rel (ADJ)) |
| 238 |
</screen> |
| 239 |
</section> |
| 240 |
|
| 241 |
<section id="rel-ct-not"> |
| 242 |
<title>None Scan</title> |
| 243 |
<indexterm> |
| 244 |
<primary>NONE</primary> |
| 245 |
</indexterm> |
| 246 |
<para> |
| 247 |
The 'NONE' option will require that none of the relations match the set. |
| 248 |
For example, position 'NONE r:rel' requires that none of the 'rel' relations match the set. |
| 249 |
</para> |
| 250 |
<screen> |
| 251 |
(NONE r:rel (ADJ)) |
| 252 |
</screen> |
| 253 |
</section> |
| 254 |
</section> |
| 255 |
|
| 256 |
</chapter> |