<!--
   Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not <https://www.gnu.org/licenses/>.

      DTD for the format of dictionaries
-->
<!ELEMENT dictionary (alphabet?, sdefs?,
		      pardefs?, section+)>
    <!-- root element-->

<!ATTLIST dictionary
        type (standard|separable|sequential) #IMPLIED
>
    <!-- dictionary type, separable/sequential is lsx compilation
         (2 names for backwards compatibility) -->

<!ELEMENT alphabet (#PCDATA)>
	<!-- alphabetic character list -->

<!ELEMENT sdefs (sdef+)>
	<!-- symbol definition section -->

<!ELEMENT sdef EMPTY>
	<!-- symbol definition -->
<!ATTLIST sdef
	n ID #REQUIRED
>
	<!-- n: symbol (tag) name -->
<!ATTLIST sdef
        c CDATA  #IMPLIED
>
        <!-- c: symbol (tag) comment -->

<!ELEMENT pardefs (pardef*)>
	<!-- paradigm definition section -->

<!ELEMENT pardef (e+)>
	<!-- paradigm definition -->
<!ATTLIST pardef
	n CDATA #REQUIRED
>
	<!-- n: paradigm name -->
<!ATTLIST pardef
        c CDATA  #IMPLIED
>
        <!-- c: comment about paradigm -->


<!ELEMENT section (e*)>
	<!-- dictionary section -->
<!ATTLIST section
	id ID #REQUIRED
	type (standard|inconditional|postblank|preblank) #REQUIRED

>
	<!-- id: dictionary section identifier -->
	<!-- type: dictionary section type -->

<!ELEMENT e (i | p | par | re | ig)+>
	<!-- entry -->
<!ATTLIST e
	r (LR|RL) #IMPLIED
	lm CDATA #IMPLIED
	a CDATA #IMPLIED
	c CDATA #IMPLIED
	i CDATA #IMPLIED
	slr CDATA #IMPLIED
	srl CDATA #IMPLIED
	alt CDATA #IMPLIED
	v CDATA #IMPLIED
	vl CDATA #IMPLIED
	vr CDATA #IMPLIED
	w CDATA #IMPLIED
>
	<!-- r: restriction LR: left-to-right,
			    RL: right-to-left -->
	<!-- lm: lemma -->
	<!-- a: author -->
	<!-- c: comment -->
	<!-- i: ignore ('yes') means ignore, otherwise it is not ignored) -->
	<!-- slr: translation sense when translating from left to right -->
	<!-- srl: translation sense when translating from right to left -->
	<!-- alt: alternative entries are omitted if not selected -->
	<!-- v: variant sets (monodix) direction restrictions based on language variant -->
	<!-- vl: variant left sets direction restrictions based on language variant for language on left of bidix -->
	<!-- vr: variant right sets direction restrictions based on language variant for language on right of bidix -->
	<!-- w: entry weight -->
<!ELEMENT par EMPTY>
	<!-- reference to paradigm -->
<!ATTLIST par
	n CDATA #REQUIRED

>
	<!-- n: paradigm name -->

<!ELEMENT i (#PCDATA | b | s | g | j | a | d | t | w)*>
	<!-- identity -->

<!ELEMENT re (#PCDATA)>
	<!-- regular expression identification -->

<!ELEMENT p (l, r)>
	<!-- pair of strings -->

<!ELEMENT l (#PCDATA | a | b | g | j | s | m | d | t | w)*>
	<!-- left part of p -->
<!ATTLIST l
    c CDATA #IMPLIED
>
	<!-- c: comment -->
<!ELEMENT r (#PCDATA | a | b | g | j | s | d | t | w)*>
	<!-- right part of p -->
<!ATTLIST r
    c CDATA #IMPLIED
>
	<!-- c: comment -->

<!ELEMENT a EMPTY>
	<!-- post-generator wake-up mark -->

<!ELEMENT b EMPTY>
	<!-- blank chars block mark -->

<!ELEMENT m EMPTY>
	<!-- mark morpheme boundary (left side only) -->

<!ELEMENT ig (#PCDATA | a | b | j | s | d | t | w)*>
	<!-- 'group identity' - equivalent to <p> where <r> contains <g>, whose contents are the same as those of <l> -->

<!ELEMENT g (#PCDATA | a | b | j | s | d | t | w)*>
	<!-- mark special groups in lemmas -->
<!ATTLIST g
	i CDATA #IMPLIED
>
	<!-- i is used to co-index groups in the left with those -->
	<!-- on the right of a pair -->

<!ELEMENT j EMPTY>
	<!-- join lexical forms -->

<!ELEMENT s EMPTY>
	<!-- reference to symbol (tag) -->
<!ATTLIST s
	n IDREF #REQUIRED

>
	<!-- n: symbol (tag) name -->

<!ELEMENT d EMPTY>
	<!-- d: LSX word boundary (delimiter) -->

<!ATTLIST d
    space (auto|yes|no) #IMPLIED
>
    <!-- space: whether to ensure a space after word end -->

<!ELEMENT t EMPTY>
    <!-- t: any tag -->

<!ELEMENT w EMPTY>
    <!-- w: any word character -->
