<?xml version="1.0" encoding="UTF-8"?>
<grammar
	xmlns="http://relaxng.org/ns/structure/1.0"
	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
	xmlns:w="http://www.wulfila.be/namespaces/legacy"
	datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
	<a:documentation>Schema for grammatical look-up tables, linked to the token and lemma data files.</a:documentation>
	<!-- 
	Revision history:
	[2026-05-29] First version.
	[2026-05-31] Documentation.
	[2026-06-18] Added abbreviation to POS info.
	
	Tom De Herdt
	https://www.wulfila.be/
	-->
	
	<include href="common.rng">
		<start>
			<ref name="root"/>
		</start>
	</include>
	
	<define name="root">
		<element name="grammar">
			<a:documentation>Grammatical look-up tables for the lemma and token data files.</a:documentation>
			<ref name="classes"/>
			<ref name="inflection"/>
			<ref name="tags"/>
		</element>
	</define>
	
	<define name="classes">
		<element name="classes">
			<a:documentation>Part-of-speech classes.</a:documentation>
			<oneOrMore>
				<element name="pos">
					<a:documentation>Part-of-speech tag, linked to lemmas (not directly to tokens).</a:documentation>
					<ref name="item.common"/>
					<optional>
						<element name="abbreviation">
						<a:documentation>Abbreviation used in the project.</a:documentation>
							<text/>
						</element>
					</optional>
				</element>
			</oneOrMore>
		</element>
	</define>
	
	<define name="inflection">
		<element name="inflection">
			<a:documentation>Inflection classes used by Gomorphv2.</a:documentation>
			<oneOrMore>
				<element name="class">
					<ref name="item.common"/>
					<attribute name="paradigm">
						<a:documentation>Inflectional paradigm type, as defined in the Gomorphv2 specification. Determines the number of cells and their names, listed in the tags element.</a:documentation>
						<ref name="list.paradigms"/>
					</attribute>
				</element>
			</oneOrMore>
		</element>
	</define>
	
	<define name="tags">
		<element name="tags">
			<a:documentation>Morphological tags used by Gomorphv2.</a:documentation>
			<oneOrMore>
				<element name="tag">
					<a:documentation>Morphological tag used by Gomorphv2. Identifies a single slot or cell in the paradigm indicated by @paradigm.</a:documentation>
					<ref name="item.common"/>
					<attribute name="paradigm">
						<a:documentation>Inflectional paradigm type, as defined in the Gomorphv2 specification.</a:documentation>
						<ref name="list.paradigms"/>
					</attribute>
				</element>
			</oneOrMore>
		</element>
	</define>
	
	<define name="list.paradigms">
		<a:documentation>Values correspond to tagset names in the Gomorphv2 specification.</a:documentation>
		<choice>
			<value>Indeclinable</value>
			<a:documentation w:id="1">Single-cell paradigm for indeclinable words, e.g. prepositions, conjunctions, particles, interjections, quoted foreign words etc.</a:documentation>
			
			<value>Noun</value>
			<a:documentation w:id="2">Paradigm for noun declensions. Nouns are inflected for gender, number and case.</a:documentation>
			
			<value>Adjective</value>
			<a:documentation w:id="3">Paradigm for adjective declensions. Adjectives are inflected for gender, number and case, and have weak and strong forms. Derived forms: comparative, superlative and adverb.</a:documentation>
			
			<value>Pronoun1</value>
			<a:documentation w:id="4">Paradigm for personal pronouns of the first and second person, inflected for number and case, but not gender; number includes singular, plural and dual.</a:documentation>
			
			<value>Pronoun2</value>
			<a:documentation w:id="5">Paradigm for the third person personal pronoun and various demonstratives and determiners. Inflected for gender, number and case; no dual number.</a:documentation>
			
			<value>Numeral1</value>
			<a:documentation w:id="6">Paradigm for numerals 2 and 3, inflected for gender and case.</a:documentation>
			
			<value>Numeral2</value>
			<a:documentation w:id="7">Paradigm for numerals 4 to 19. Normally not inflected, but some dative and genitive forms occur.</a:documentation>
			
			<value>Verb</value>
			<a:documentation w:id="8">Paradigm for verbs. Verbs are inflected for person, number, tense, mood and voice. Derived forms: present and past participle.</a:documentation>
		</choice>
	</define>
	

</grammar>