Download A framework for processing and presenting parallel text corpora

Transcript
2.4
·
XTE - A new standoff markup scheme
Listing 2.15: div1.dtd (continued)
<!ENTITY % sentence.parts "EMPTY">
<!ELEMENT s %sentence.parts;>
<!ATTLIST s %default.attributes;>
Notice how the sentence element is declared as empty element. However, by doing this
indirectly with the help of a parameter entity, the user of the encoding will have the possibility to further subdivide the sentence element if she needs to do so. Listing 2.17, which
combines this encoding with another partial encoding and the base XTE DTD, shows how
such an extension can be accomplished.
The next listing shows the second example of a partial encoding which can be plugged
into and used together with the base XTE DTD. It divides the underlying text into lines and
pages according to an actual printed edition. The edition may be specified in the edition
attribute of the pages element. The hyphen attribute indicates whether the last word of a
line is hyphenated while the para-pos attribute specifies the position of a line in the paragraph. The last two attributes can be used as hints by view classes when they render these
elements.
Listing 2.16: pages.dtd
<!-An external encoding which can be used with the XTE DTD version 0.1
This encoding divides the text into pages and lines as present in a certain
edition of a printed version of the text.
-->
<!ELEMENT pages (page+)>
<!ATTLIST pages %default.attributes;
edition CDATA #IMPLIED>
<!ELEMENT page (line+)>
<!ATTLIST page %default.attributes;>
<!ELEMENT line EMPTY>
<!ATTLIST line %default.attributes;
para-pos (begin | end | default) "default"
hyphen
(true) #IMPLIED
>
Finally, listing 2.17 shows how the encodings defined in listing 2.15 and 2.16 can be combined and used together with the base XTE DTD. First of all, the parameter entity local.encodings is defined to be either div1 or pages. This has to be done before the inclusion of the XTE DTD as an external entity in order to overwrite the empty definition of
local.encodings their. Then the two partial encodings presented before are pulled into the
file by declaring them as external entities respectively.
Notice how the sentence element which is declared as an empty element in listing 2.15
is extended to contain latin and french elements (which can denote latin and french words
in a text) by redefinition of the parameter entity sentence.parts. Also notice how the use of
the standard element attributes defined in the main XTE DTD is only possible in the partial
Dissertation der Fak. f. Informations- u. Kognitionswissenschaften, Univ. Tübingen - 2004
29