/usr/share/apertium/interchunk.dtd is in apertium 3.1.0-1.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | <?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Draft of DTD for the structural transfer rule files
Sergio Ortiz, Gema Ramírez-Sánchez, Mireia Ginestí, Mikel L. Forcada,
2005.07.29.
-->
<!ENTITY % condition "(and|or|not|equal|begins-with|begins-with-list|ends-with|ends-with-list|contains-substring|in)">
<!ENTITY % container "(var|clip)">
<!ENTITY % sentence "(let|out|choose|modify-case|call-macro|append)">
<!ENTITY % value "(b|clip|lit|lit-tag|var|get-case-from|case-of|concat)">
<!ENTITY % stringvalue "(clip|lit|var|get-case-from|case-of)">
<!ELEMENT interchunk (section-def-cats, section-def-attrs, section-def-vars, section-def-lists?, section-def-macros?, section-rules)>
<!--
'interchunk' is the root element containing the whole structural
interchunk rule file.
-->
<!ELEMENT section-def-cats (def-cat+)>
<!--
The 'def-cats' section defines the categories used to build the
patterns used in rules
-->
<!ELEMENT def-cat (cat-item+)>
<!ATTLIST def-cat n ID #REQUIRED>
<!--
Each 'def-cat' defines one category in terms of a list of
category items and has a unique name 'n', which is mandatory
-->
<!ELEMENT cat-item EMPTY>
<!ATTLIST cat-item lemma CDATA #IMPLIED
tags CDATA #REQUIRED >
<!--
Each 'cat-item' (category item) represents a set of lexical forms
and has a mandatory attribute 'tags' whose value is a sequence of
dot-separated tag names; this sequence is a subsequence of the
tag sequence defining each possible lexical form. For example,
tags="n.f" would match all lexical forms containing this tag
sequence, such as "^casa<n><f><pl>$".
In addition, an optional attribute, "lemma", may be used to
define lexical forms having a particular substring in their lemma
-->
<!ELEMENT section-def-attrs (def-attr+)>
<!--
The 'def-attrs' section defines the attributes that will be
identified in matched lexical forms
-->
<!ELEMENT def-attr (attr-item+)>
<!ATTLIST def-attr n ID #REQUIRED>
<!--
Each def-attr defines one attribute in terms of a list of
attribute items and has a mandatory unique name n
-->
<!ELEMENT attr-item EMPTY>
<!ATTLIST attr-item tags CDATA #IMPLIED>
<!--
Each 'attr-item' specifies a subsequence of the tags in
that lexical form (attribute 'tags')
-->
<!ELEMENT section-def-vars (def-var+)>
<!--
The 'def-vars' section defines the global variables
that will be used to transfer information between rules
-->
<!ELEMENT def-var EMPTY>
<!ATTLIST def-var n ID #REQUIRED
v CDATA #IMPLIED>
<!--
The definition of a global variable has a mandatory unique name 'n' that
will be used to refer to it. A value of initialization can also be specified
by means the 'v' attribute. The default value of the initialization is the
empty string.
-->
<!ELEMENT section-def-lists (def-list)+>
<!--
Element 'section-def-lists' encloses a set of list definitions
-->
<!ELEMENT def-list (list-item+)>
<!ATTLIST def-list n ID #REQUIRED>
<!--
The 'def-list' element defines a named list to search with the 'in'
element. Attribute 'n' sets the name of the list
-->
<!ELEMENT list-item EMPTY>
<!ATTLIST list-item v CDATA #REQUIRED>
<!--
Attribute 'v' of 'list-item' element contains the value to be added to
the list being defined
-->
<!ELEMENT section-def-macros (def-macro)+>
<!--
The 'def-macros' section defines macros containing portions of
code frequently used in the action part of rules
-->
<!ELEMENT def-macro (%sentence;)+>
<!ATTLIST def-macro n ID #REQUIRED>
<!ATTLIST def-macro npar CDATA #REQUIRED>
<!--
Macro definition:
A macro has a mandatory name (the value of 'n'), a number of parameters
(the value of 'npar') and a body containing arguments and statements.
-->
<!ELEMENT section-rules (rule+)>
<!--
The rules section contains a sequence of one or more rules
-->
<!ELEMENT rule (pattern, action)>
<!ATTLIST rule comment CDATA #IMPLIED>
<!--
Each rule has a pattern and an action
* attribute 'comment' allows to put in comments about the purpose of
the rule being defined
-->
<!ELEMENT pattern (pattern-item+)>
<!--
The pattern is specified in terms of pattern items, each one
representing a lexical form in the matched pattern
-->
<!ELEMENT pattern-item EMPTY>
<!ATTLIST pattern-item n IDREF #REQUIRED>
<!--
Each attribute to be activated is referred to by its name in the def-cats section
-->
<!ELEMENT action (%sentence;)*>
<!--
Encloses the procedural part of a rule
-->
<!ELEMENT choose (when+,otherwise?)>
<!--
The choose statement is a selection statement (similar to a case
statement) composed of one or more tested cases and an optional
otherwise
-->
<!ELEMENT when (test,(%sentence;)*)>
<!--
Each tested case is a block of zero or more statements
-->
<!ELEMENT otherwise (%sentence;)+>
<!--
The otherwise case is also a block of one or more statements
-->
<!ELEMENT test (%condition;)>
<!--
The test in a tested case may be a conjunction, a disjunction, or
a negation of simpler tests, as well as a simple equality test
-->
<!ELEMENT and ((%condition;),(%condition;)+)>
<!--
Each conjuntion test contains two or more simpler tests
-->
<!ELEMENT or ((%condition;),(%condition;)+)>
<!--
Each disjunction test contains two or more simpler tests
-->
<!ELEMENT not (%condition;)>
<!--
The negation of a simpler test is a test itself
-->
<!ELEMENT equal (%value;,%value;)>
<!ATTLIST equal caseless (no|yes) #IMPLIED>
<!--
The simplest test is an equality test. The right part and the
left part of the equality may both be a clip (see below), a
literal string ('lit'), a literal tag ('lit-tag') or the value of
a variable ('var') defined in the def-vars section. When the attribute
'caseless' is set to 'yes', the comparison is made without attending
to the case.
-->
<!ELEMENT begins-with (%value;,%value;)>
<!ATTLIST begins-with caseless (no|yes) #IMPLIED>
<!--
Tests if the left part contains the right part at the beginning.
Both parts of the test may both be a clip (see below), a
literal string ('lit'), a literal tag ('lit-tag') or the value of
a variable ('var') defined in the def-vars section. When the attribute
'caseless' is set to 'yes', the comparison is made without attending
to the case.
-->
<!ELEMENT ends-with (%value;,%value;)>
<!ATTLIST ends-with caseless (no|yes) #IMPLIED>
<!--
Tests if the left part contains the right part at the end.
Both parts of the test may both be a clip (see below), a
literal string ('lit'), a literal tag ('lit-tag') or the value of
a variable ('var') defined in the def-vars section. When the attribute
'caseless' is set to 'yes', the comparison is made without attending
to the case.
-->
<!ELEMENT begins-with-list (%value;,list)>
<!ATTLIST begins-with-list caseless (no|yes) #IMPLIED>
<!--
Tests if the left part contains the right part at the beginning.
First parts of the test may be a clip (see below), a
literal string ('lit'), a literal tag ('lit-tag') or the value of
a variable ('var') defined in the def-vars section. The second part
must be always a list. When the attribute
'caseless' is set to 'yes', the comparison is made without attending
to the case.
-->
<!ELEMENT ends-with-list (%value;,list)>
<!ATTLIST ends-with-list caseless (no|yes) #IMPLIED>
<!--
Tests if the left part contains the right part at the end.
First parts of the test may be a clip (see below), a
literal string ('lit'), a literal tag ('lit-tag') or the value of
a variable ('var') defined in the def-vars section. The second part
must be always a list. When the attribute
'caseless' is set to 'yes', the comparison is made without attending
to the case.
-->
<!ELEMENT contains-substring (%value;,%value;)>
<!ATTLIST contains-substring caseless (no|yes) #IMPLIED>
<!--
Tests if the left part contains the right part.
Both parts of the test may both be a clip (see below), a
literal string ('lit'), a literal tag ('lit-tag') or the value of
a variable ('var') defined in the def-vars section. When the attribute
'caseless' is set to 'yes', the comparison is made without attending
to the case.
-->
<!ELEMENT in (%value;, list)>
<!ATTLIST in caseless (no|yes) #IMPLIED>
<!--
'in' performs a search of a value in a list. If 'caseless' is set to yes,
this search is performed without attending to the case
-->
<!ELEMENT list EMPTY>
<!ATTLIST list n IDREF #REQUIRED>
<!--
'list' refers, with the name in attribute 'n', a list defined before in
the 'section-def-list' section
-->
<!ELEMENT let (%container;, %value;)>
<!--
An assignment statement ('let') assigns the value of a clip (see
below), a literal string ('lit'), a literal tag('lit-tag') or the
value of a global variable ('var') to either a global variable ('var')
or a clip
-->
<!ELEMENT append (%value;)+>
<!ATTLIST append n IDREF #REQUIRED>
<!--
This instruction appends the value of a clip (see
below), a literal string ('lit'), a literal tag('lit-tag') or the
value of a global variable ('var') to either a global variable ('var')
or a clip, identified by the "n" attribute
-->
<!ELEMENT out (b|chunk|var)+>
<!--
'out' is an output statement; it may output blanks or chunks
-->
<!ELEMENT modify-case (%container;, %stringvalue;)>
<!--
The first argument of 'modify-case' copy the case of the second
argument.
-->
<!ELEMENT call-macro (with-param)*>
<!ATTLIST call-macro n IDREF #REQUIRED>
<!--
A macro may be called anywhere by name with one or more
arguments
-->
<!ELEMENT with-param EMPTY>
<!ATTLIST with-param pos CDATA #REQUIRED>
<!--
The attribute pos in each argument is used to refer to a lexical
form in the current rule. For example, if a 2-parameter macro
has been defined to perform noun-adjective agreement operations,
it may be used with arguments 1 and 2 in a noun-adjective rule,
with arguments 2, 3 and 1 in a determiner-noun-adjective rule, with
arguments 1 and 3 in a noun-adverb-adjective rule, and with
arguments 2 and 1 in an adjective-noun rule
-->
<!ELEMENT clip EMPTY>
<!ATTLIST clip pos CDATA #REQUIRED
part CDATA #REQUIRED>
<!--
A 'clip' is a substring of a source-language or target-language
lexical form, extracted according to an attribute:
* 'pos' is an index (1, 2, 3...) used to select a lexical form
inside the rule;
* the value of 'part' is the name of an attribute defined in
def-attrs, but may take also the values 'lem' (referring to
the lemma of the lexical form), 'lemh' (lemma head), 'lemq'
(lemma queue) and 'whole' (referring to the whole lexical form).
-->
<!ELEMENT lit EMPTY>
<!ATTLIST lit v CDATA #REQUIRED>
<!--
A literal string value: the value of the literal is the value of
the 'v' attribute
-->
<!ELEMENT lit-tag EMPTY>
<!ATTLIST lit-tag v CDATA #REQUIRED>
<!--
A literal string value: the value of the literal is the value of
the 'v' attribute
-->
<!ELEMENT var EMPTY>
<!ATTLIST var n IDREF #REQUIRED>
<!--
Each 'var' is a variable identifier: the attribute n is the name
of the variable. When it is in an 'out', a 'test', or the right
part of a 'let', it represents the value of the variable; when in
the left part of a 'let' it represents the reference of the
variable.
-->
<!ELEMENT get-case-from (clip|lit|var)>
<!ATTLIST get-case-from pos CDATA #REQUIRED>
<!-- Atención, falta modificar todos los comentarios donde intervenga
get-case-from -->
<!ELEMENT case-of EMPTY>
<!ATTLIST case-of pos CDATA #REQUIRED
part CDATA #REQUIRED>
<!--
A 'case-of' is a value representing the case of a "clip". This value
will be "aa" (all lowercase), "Aa" (first uppercase) and "AA",
(all uppercase).
* 'pos' is an index (1, 2, 3...) used to select a lexical form
inside the rule;
* the value of 'part' is the name of an attribute defined in
def-attrs, but may take also the values 'lem' (referring to
the lemma of the lexical form), 'lemh' (lemma head), 'lemq'
(lemma queue) and 'whole' (referring to the whole lexical form).
-->
<!ELEMENT concat (%value;)+>
<!-- Concatenates a sequence of values -->
<!ELEMENT chunk (%value;)+>
<!--
Encloses a chunk inside an 'out' element.
-->
<!ELEMENT pseudolemma (%value;)>
<!ELEMENT b EMPTY>
<!ATTLIST b pos CDATA #IMPLIED>
<!--
'b' is a [super]blanks item, indexed by pos; for example, a 'b'
with pos="2" refers to the [super]blanks (including format data
encapsulated by the de-formatter) between lexical form 2 and
lexical form 3. Managing [super]blanks explicitly allows for the
correct placement of format when the result of structural
transfer has more or less lexical items than the original or has
been reordered in some way. If attribute "pos" is not specified, then
a single blank (ASCII 32) is generated.
-->
|