Skip to content

Commit da17b99

Browse files
committed
maj schéma glossaire
1 parent d120b0a commit da17b99

6 files changed

Lines changed: 105 additions & 14 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Transformation du glossaire XML en TEI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
transform-and-validate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name : Récupérer le dépôt
12+
uses: actions/checkout@v5
13+
14+
- name: Installer Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.12'
18+
19+
- name: Installer Java
20+
uses: actions/setup-java@v5
21+
with:
22+
distribution: 'temurin'
23+
java-version: '17'
24+
25+
- name: Installer Saxon-HE
26+
run: |
27+
python -m pip install saxon-he
28+
pip install saxonche
29+
30+
- name: Installer Jing
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y jing
34+
35+
- name: Transformation XSLT
36+
run: python tools/transform_glossaire.py
37+
38+
- name: Validation du glossaire transformé
39+
run: bash tools/validate_glossaire.sh
40+
41+
- name: Notification Discord succès
42+
if: success()
43+
run: |
44+
curl -H "Content-Type: application/json" \
45+
-d '{"content":"✅ Pipeline TEI OK\n📦 Repo: ${{ github.repository }}\n🌿 branche ${{ github.ref_name }}\n🔁 Commit : ${{ github.sha }}\"}' \
46+
"${{ secrets.DISCORD_WEBHOOK_URL }}"
47+
48+
- name: Notification Discord échec
49+
if: failure()
50+
run: |
51+
curl -H "Content-Type: application/json" \
52+
-d "{\"content\":\"❌ Pipeline TEI ECHEC\n📦 Repo : ${{ github.repository }}\n🌿 Branche : ${{ github.ref_name }}\n🔁 Commit : ${{ github.sha }}\n👉 Voir logs : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}" \
53+
"${{ secrets.DISCORD_WEBHOOK_URL }}"

.github/workflows/validation-rng.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Validation RNG
1+
name: Validation du schémaRNG
22

33
on:
44
push:
@@ -103,12 +103,12 @@ jobs:
103103
if: success()
104104
run: |
105105
curl -H "Content-Type: application/json" \
106-
-d '{"content":"✅ Validation RNG : success — ${{ github.repository }} — branche ${{ github.ref_name }}$"}' \
106+
-d '{"content":"✅ Validation RNG : SUCCES — ${{ github.repository }} — branche ${{ github.ref_name }}"}' \
107107
"${{ secrets.DISCORD_WEBHOOK_URL }}"
108108
109109
- name: Notification Discord échec
110110
if: failure()
111111
run: |
112112
curl -H "Content-Type: application/json" \
113-
-d '{"content":"❌ Validation RNG : failure — ${{ github.repository }} — branche ${{ github.ref_name }}$"}' \
113+
-d '{"content":"❌ Validation RNG : ECHEC — ${{ github.repository }} — branche ${{ github.ref_name }}"}' \
114114
"${{ secrets.DISCORD_WEBHOOK_URL }}"

schemas/glossaire-tei.rng

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:xlink="http://www.w3.org/1999/xlink"
66
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
77
ns="http://www.tei-c.org/ns/1.0"><!--
8-
Schema generated from ODD source 2026-03-20T19:58:09Z. .
8+
Schema generated from ODD source 2026-03-22T14:31:20Z. .
99
TEI Edition: P5 Version 4.11.0. Last updated on 18th February 2026, revision 358d2e48e
1010
TEI Edition Location: https://www.tei-c.org/Vault/P5/4.11.0/
1111
Personnalisation TEI pour un glossaire autonome, en lien avec une édition critique numérique, produit automatiquement depuis un schéma XML de travail.
@@ -138,7 +138,7 @@ TEI Edition Location: https://www.tei-c.org/Vault/P5/4.11.0/
138138
</choice>
139139
</zeroOrMore>
140140
</element>
141-
<pattern xmlns="http://purl.oclc.org/dsdl/schematron" id="d4484335e74066-constraint">
141+
<pattern xmlns="http://purl.oclc.org/dsdl/schematron" id="d4723987e73931-constraint">
142142
<rule context="tei:content">
143143
<report test="descendant::*[not(namespace-uri(.) = ('http://relaxng.org/ns/compatibility/annotations/1.0', 'http://relaxng.org/ns/structure/1.0', 'http://www.tei-c.org/ns/1.0'))]">content descendants must be in the
144144
namespaces
@@ -208,7 +208,7 @@ TEI Edition Location: https://www.tei-c.org/Vault/P5/4.11.0/
208208
</choice>
209209
</zeroOrMore>
210210
</element>
211-
<pattern xmlns="http://purl.oclc.org/dsdl/schematron" id="d4484335e75747-constraint">
211+
<pattern xmlns="http://purl.oclc.org/dsdl/schematron" id="d4723987e75612-constraint">
212212
<rule context="tei:datatype">
213213
<report test="descendant::*[not(namespace-uri(.) = ('http://relaxng.org/ns/structure/1.0', 'http://www.tei-c.org/ns/1.0'))]">datatype descendants must be in the
214214
namespaces
@@ -5341,7 +5341,9 @@ Suggested values include: 1] gloss (gloss); 2] index (index); 3] instructions (i
53415341
</define>
53425342
<define name="tei_note">
53435343
<element name="note">
5344-
<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(note) contient une note ou une annotation. [3.9.1. Notes and Simple Annotation 2.2.6. The Notes Statement 3.12.2.8. Notes and Statement of Language 10.3.5.4. Notes within Entries]</a:documentation>
5344+
<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(Élément d’annotation) L’élément <code xmlns="http://www.w3.org/1999/xhtml"
5345+
xmlns:rng="http://relaxng.org/ns/structure/1.0">&lt;note&gt;</code> peut être utilisé pour porter des annotations diverses, qui peuvent être de tout type. Dans cette personnalisation, on l’emploie notamment pour encoder le nombre d’occurrences d’un terme dans un élément <code xmlns="http://www.w3.org/1999/xhtml"
5346+
xmlns:rng="http://relaxng.org/ns/structure/1.0">&lt;entry&gt;</code>. [3.9.1. Notes and Simple Annotation 2.2.6. The Notes Statement 3.12.2.8. Notes and Statement of Language 10.3.5.4. Notes within Entries]</a:documentation>
53455347
<ref name="tei_macro.specialPara"/>
53465348
<ref name="tei_att.global.attributes"/>
53475349
<ref name="tei_att.anchoring.attributes"/>
@@ -9006,6 +9008,7 @@ Suggested values include: 1] main; 2] hom (homograph); 3] xref (cross reference)
90069008
<ref name="tei_sense"/>
90079009
<ref name="tei_xr"/>
90089010
</choice>
9011+
<ref name="tei_note"/>
90099012
</group>
90109013
<ref name="tei_att.global.attributes"/>
90119014
<ref name="tei_att.entryLike.attributes"/>

schemas/glossaire.tei.odd.xml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<revisionDesc>
3030
<change when="2026-03-20">Génération d’une structure initiale pour un ODD décrivant la structure du glossaire TEI via le modèle d’IA GPT-5.3
3131
à partir du modèle conceptuel prévu pour la transformation XSLT depuis le schéma XML de travail vers le format TEI. Éléments de documentation enrichis manuellement ensuite.</change>
32+
<change when="2026-03-22">Ajout manuel d’un élément <gi>note</gi> pour porter le nombre d’occurrences d’un terme dans une entrée du glossaire.</change>
3233
</revisionDesc>
3334
</teiHeader>
3435

@@ -105,12 +106,13 @@
105106
<rng:ref name="sense" />
106107
<rng:ref name="xr" />
107108
</rng:choice>
109+
<rng:ref name="note" />
108110
</rng:group>
109111
</content>
110112
<remarks>
111113
<p>L’ordre retenu est le suivant :
112114
une ou plusieurs formes (<gi>form</gi>), suivies soit d’un bloc sémantique (<gi>sense</gi>),
113-
soit d’un renvoi (<gi>xr</gi>)</p>
115+
soit d’un renvoi (<gi>xr</gi>), et enfin d’une note (<gi>note</gi>) comptabilisant le nombre d’occurrences</p>
114116
</remarks>
115117
<exemplum>
116118
<egXML xmlns="http://www.tei-c.org/ns/Examples">
@@ -126,6 +128,33 @@
126128
</exemplum>
127129
</elementSpec>
128130

131+
<elementSpec ident="note"
132+
mode="change"
133+
module="core">
134+
<gloss>Élément d’annotation</gloss>
135+
<desc>L’élément <gi>note</gi> peut être utilisé pour porter des annotations diverses, qui peuvent être de tout type.
136+
Dans cette personnalisation, on l’emploie notamment pour encoder le nombre d’occurrences d’un terme dans un élément <gi>entry</gi>.</desc>
137+
<exemplum>
138+
<egXML xmlns="http://www.tei-c.org/ns/Examples">
139+
<entry xml:id="gls-0001">
140+
<form type="lemme">
141+
<orth xml:lang="la">mare</orth>
142+
</form>
143+
<sense>
144+
<def xml:lang="fr">mer</def>
145+
</sense>
146+
<note type="occurrences" n="12">
147+
12
148+
</note>
149+
</entry>
150+
</egXML>
151+
</exemplum>
152+
<remarks>
153+
<p> Si on intègre note pour l’encodage du nombre d’occurrences, on lui conserve son comportement générique pour pouvoir l’utiliser pour d’autres types d’annotations, en cas d’extension des fonctions de la structure TEI du glossaire</p>
154+
</remarks>
155+
</elementSpec>
156+
157+
129158
<elementSpec ident="form"
130159
mode="change"
131160
module="dictionaries">

tools/transform.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from saxonche import *
22

33
with PySaxonProcessor(license=False) as proc:
4-
fichier = open("latex\\memoire.tex", "w", encoding="utf-8")
54
xsltproc = proc.new_xslt30_processor()
6-
executable = xsltproc.compile_stylesheet(stylesheet_file="xslt\\transform.xsl")
7-
document = proc.parse_xml(xml_file_name='guillaume-de-boldensele.xml')
5+
executable = xsltproc.compile_stylesheet(stylesheet_file="../xslt/odt-vers-glossaireXML.xsl")
6+
document = proc.parse_xml(xml_file_name='../work/transcription_boldensele.fodt')
87
output = executable.transform_to_string(xdm_node=document)
9-
print(output)
10-
fichier.write(output)
11-
fichier.close()
8+
9+
with open("../data/glossaire.xml", "w", encoding="utf-8") as f:
10+
f.write(output)

xslt/glossaireXML-vers-glossaireTEI.xsl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@
6464
</entry>
6565
</xsl:template>
6666

67+
<xsl:template match="gls:nombre-occurrences">
68+
<xsl:variable name="valeur-occurrences" select="normalize-space(.)" />
69+
<note type="occurrences" n="{$valeur-occurrences}">
70+
<xsl:value-of select="$valeur-occurrences" />
71+
</note>
72+
</xsl:template>
73+
6774
<xsl:template match="gls:definition">
6875
<sense>
6976
<def xml:lang="{$lang-glossaire}">

0 commit comments

Comments
 (0)