| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<transfer default="chunk"> |
| 3 |
<section-def-cats> |
| 4 |
<def-cat n="vblexpassfv"> |
| 5 |
<cat-item tags="vblex.pres.pasv"/> |
| 6 |
<cat-item tags="vblex.pret.pasv"/> |
| 7 |
<cat-item tags="vblex.pstv.pres"/> |
| 8 |
</def-cat> |
| 9 |
<def-cat n="prn"> |
| 10 |
<cat-item tags="prn.*"/> |
| 11 |
</def-cat> |
| 12 |
<def-cat n="nacr"> |
| 13 |
<cat-item tags="n.acr"/> |
| 14 |
</def-cat> |
| 15 |
<def-cat n="det"> |
| 16 |
<cat-item tags="det"/> |
| 17 |
</def-cat> |
| 18 |
<def-cat n="adj"> |
| 19 |
<cat-item tags="adj"/> |
| 20 |
</def-cat> |
| 21 |
</section-def-cats> |
| 22 |
<section-def-attrs> |
| 23 |
<def-attr n="a_nom"> |
| 24 |
<attr-item tags="n"/> |
| 25 |
<attr-item tags="np"/> |
| 26 |
</def-attr> |
| 27 |
</section-def-attrs> |
| 28 |
|
| 29 |
<section-def-vars> |
| 30 |
<def-var n="caseFirstWord"/> |
| 31 |
<def-var n="tmp"/> |
| 32 |
</section-def-vars> |
| 33 |
|
| 34 |
<section-def-lists> |
| 35 |
<def-list n="foo"> |
| 36 |
<list-item v="foo"/> |
| 37 |
</def-list> |
| 38 |
</section-def-lists> |
| 39 |
|
| 40 |
<section-def-macros> |
| 41 |
<def-macro n="set_caseFirstWord" npar="1" |
| 42 |
c="Downcases the argument, unless np"> |
| 43 |
<!-- TODO: Put a marker for acronyms where we don't want to copy case from them; then drop the tag --> |
| 44 |
<choose><when> |
| 45 |
<test><not><equal><clip pos="1" side="tl" part="a_nom"/><lit-tag v="np"/></equal></not></test> |
| 46 |
<modify-case><clip pos="1" side="tl" part="lemh"/><lit v="aa"/></modify-case> |
| 47 |
</when></choose> |
| 48 |
<choose> |
| 49 |
<when c="Proper noun, not first word in sentence: let first word have lowercase"> |
| 50 |
<test><and> |
| 51 |
<not><equal><var n="caseFirstWord"/><lit v=""/></equal></not> |
| 52 |
<begins-with><clip pos="1" side="tl" part="a_nom"/><lit-tag v="np"/></begins-with> |
| 53 |
</and></test> |
| 54 |
<let><var n="caseFirstWord"/><lit v="aa"/></let> |
| 55 |
</when> |
| 56 |
<otherwise> |
| 57 |
<let><var n="caseFirstWord"/><get-case-from pos="1"><lit v="aa"/></get-case-from></let> |
| 58 |
</otherwise> |
| 59 |
</choose> |
| 60 |
|
| 61 |
</def-macro> |
| 62 |
</section-def-macros> |
| 63 |
|
| 64 |
<section-rules> |
| 65 |
<rule> |
| 66 |
<pattern> |
| 67 |
<pattern-item n="vblexpassfv"/> |
| 68 |
</pattern> |
| 69 |
<action> |
| 70 |
<let> |
| 71 |
<var n="tmp"/> |
| 72 |
<concat> |
| 73 |
<lit v="sl-lemq:'"/><clip pos="1" side="sl" part="lemq"/> |
| 74 |
<lit v="' tl-lemq:'"/><clip pos="1" side="tl" part="lemq"/> |
| 75 |
<lit v="'"/> |
| 76 |
</concat> |
| 77 |
</let> |
| 78 |
<out><var n="tmp"/></out> |
| 79 |
</action> |
| 80 |
</rule> |
| 81 |
|
| 82 |
<rule comment="PRN"> |
| 83 |
<pattern> |
| 84 |
<pattern-item n="prn"/> |
| 85 |
</pattern> |
| 86 |
<action> |
| 87 |
<call-macro n="set_caseFirstWord"><with-param pos="1"/></call-macro> |
| 88 |
<out> |
| 89 |
<chunk name="prn" case="caseFirstWord"> |
| 90 |
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags> |
| 91 |
<lu><clip pos="1" side="tl" part="whole"/></lu> |
| 92 |
</chunk> |
| 93 |
</out> |
| 94 |
</action> |
| 95 |
</rule> |
| 96 |
|
| 97 |
<rule comment="blankrule"> <!-- dummy rule for blank testing --> |
| 98 |
<pattern> |
| 99 |
<pattern-item n="nacr"/> |
| 100 |
<pattern-item n="nacr"/> |
| 101 |
<pattern-item n="prn"/> |
| 102 |
</pattern> |
| 103 |
<action> |
| 104 |
<out> |
| 105 |
<chunk name="prn" case="caseFirstWord"> |
| 106 |
<tags><tag><clip pos="3" side="tl" part="tags"/></tag></tags> |
| 107 |
<lu><clip pos="3" side="tl" part="whole"/></lu> |
| 108 |
<lu> |
| 109 |
<clip pos="2" side="tl" part="lem"/> |
| 110 |
<lit-tag v="nacr.sg.m"/> |
| 111 |
</lu> |
| 112 |
</chunk> |
| 113 |
<b/> |
| 114 |
<chunk name="det" case="caseFirstWord"> |
| 115 |
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags> |
| 116 |
<mlu> |
| 117 |
<lu><clip pos="1" side="tl" part="whole"/></lu> |
| 118 |
<lu><clip pos="3" side="tl" part="whole"/></lu> |
| 119 |
</mlu> |
| 120 |
</chunk> |
| 121 |
<b/> |
| 122 |
</out> |
| 123 |
</action> |
| 124 |
</rule> |
| 125 |
|
| 126 |
<rule comment="blankrule_single"> |
| 127 |
<pattern> |
| 128 |
<pattern-item n="nacr"/> |
| 129 |
</pattern> |
| 130 |
<action> |
| 131 |
<out> |
| 132 |
<chunk name="nacr" case="caseFirstWord"> |
| 133 |
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags> |
| 134 |
<lu><concat><lit v="test"/><lit-tag v="n.sg"/></concat></lu> |
| 135 |
<b/> |
| 136 |
<lu><clip pos="1" side="tl" part="whole"/></lu> |
| 137 |
</chunk> |
| 138 |
<b/> |
| 139 |
<chunk name="nacr2" case="caseFirstWord"> |
| 140 |
<tags><tag><clip pos="1" side="tl" part="tags"/></tag></tags> |
| 141 |
<lu><concat><lit v="testlem"/><lit-tag v="n.pl"/></concat></lu> |
| 142 |
<b/> |
| 143 |
<mlu> |
| 144 |
<lu><clip pos="1" side="tl" part="whole"/></lu> |
| 145 |
<lu><concat><lit v="postp"/><lit-tag v="adj.sg"/></concat></lu> |
| 146 |
</mlu> |
| 147 |
</chunk> |
| 148 |
</out> |
| 149 |
</action> |
| 150 |
</rule> |
| 151 |
|
| 152 |
<rule comment="superblankrule1"> |
| 153 |
<pattern> |
| 154 |
<pattern-item n="det"/> |
| 155 |
<pattern-item n="adj"/> |
| 156 |
<pattern-item n="nacr"/> |
| 157 |
</pattern> |
| 158 |
<action> |
| 159 |
<out> |
| 160 |
<chunk name ="test1" case="caseFirstWord"> |
| 161 |
<tags><tag><clip pos="2" side="tl" part="tags"/></tag></tags> |
| 162 |
<lu><clip pos="1" side="tl" part="whole"/></lu> |
| 163 |
<lu><clip pos="2" side="tl" part="whole"/></lu> |
| 164 |
<lu><clip pos="3" side="tl" part="whole"/></lu> |
| 165 |
</chunk> |
| 166 |
</out> |
| 167 |
</action> |
| 168 |
</rule> |
| 169 |
|
| 170 |
<rule comment="superblankrule2"> |
| 171 |
<pattern> |
| 172 |
<pattern-item n="adj"/> |
| 173 |
<pattern-item n="det"/> |
| 174 |
<pattern-item n="nacr"/> |
| 175 |
</pattern> |
| 176 |
<action> |
| 177 |
<out> |
| 178 |
<chunk name ="test1" case="caseFirstWord"> |
| 179 |
<tags><tag><clip pos="2" side="tl" part="tags"/></tag></tags> |
| 180 |
<lu><clip pos="2" side="tl" part="whole"/></lu> |
| 181 |
<b/> |
| 182 |
<lu><clip pos="3" side="tl" part="whole"/></lu> |
| 183 |
</chunk> |
| 184 |
</out> |
| 185 |
</action> |
| 186 |
</rule> |
| 187 |
|
| 188 |
<rule comment="superblankrule3"> |
| 189 |
<pattern> |
| 190 |
<pattern-item n="nacr"/> |
| 191 |
<pattern-item n="det"/> |
| 192 |
</pattern> |
| 193 |
<action> |
| 194 |
<out> |
| 195 |
<chunk name ="test1" case="caseFirstWord"> |
| 196 |
<tags><tag><clip pos="2" side="tl" part="tags"/></tag></tags> |
| 197 |
<lu><clip pos="1" side="tl" part="whole"/></lu> |
| 198 |
<b/> |
| 199 |
<lu><clip pos="2" side="tl" part="whole"/></lu> |
| 200 |
<b/> |
| 201 |
<lu><clip pos="1" side="tl" part="whole"/></lu> |
| 202 |
<b/> |
| 203 |
<lu><clip pos="2" side="tl" part="whole"/></lu> |
| 204 |
</chunk> |
| 205 |
</out> |
| 206 |
</action> |
| 207 |
</rule> |
| 208 |
|
| 209 |
</section-rules> |
| 210 |
</transfer> |