Compare commits
2 commits
cee3efab31
...
d39a72004d
Author | SHA1 | Date | |
---|---|---|---|
|
d39a72004d | ||
|
71219733bd |
32 changed files with 9277 additions and 2 deletions
37
README.md
37
README.md
|
@ -1,3 +1,36 @@
|
||||||
# abaev-basex
|
# BaseX webapp of the electronic HEDO
|
||||||
|
|
||||||
BaseX webapp of the electronic HEDO
|
This repository contains the webapp files to be used with [BaseX](https://basex.org/) running as a webapp, plus some scripts to convert between different XML representations.
|
||||||
|
|
||||||
|
Original code written by Oleg Belyaev in 2024–2025.
|
||||||
|
|
||||||
|
A public version of this database is currently available [here](https://abaev.belyaev.io/dict).
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
In order to recreate the server setup, you have to make the following steps:
|
||||||
|
|
||||||
|
1. Install BaseX. Make sure that [Saxon](https://www.saxonica.com/) is in your classpath (the open source HE will do). This can be done either directly through the environment variable CLASSPATH, or by putting Saxon's JAR files (all of them, including those in `lib/`) into `basex/lib/custom`.
|
||||||
|
|
||||||
|
2. Create databases called `abaevdict`, `abaevdict_en`, `abaevdict_ru`, `abaevdict_index`. Their roles are as follows:
|
||||||
|
|
||||||
|
- `abaevdict` contains the bilingual XML files of the dictionary encoded in the [Abaev TEI](https://github.com/abaevdict/tei-abaev) format.
|
||||||
|
These generally come from the [abaev-xml](https://code.cucurri.ru/abaevdict/abaev-xml) repo.
|
||||||
|
- `abaevdict_en` and `abaevdict_ru` contain the preprocessed, standardized English and Russian XML editions of HEDO. This is done because maintaining a single bilingual database is impractical: users will want to interact with the English and Russian versions only. At some point, they may even diverge. For basic linking, entry IDs should suffice.
|
||||||
|
- `abaevdict_index` includes various helper documents that are not directly displayed, but used for faster lookup, and for REST API queries.
|
||||||
|
|
||||||
|
3. Import the contents of the `entries` folder of [abaev-xml](https://code.cucurri.ru/abaevdict/abaev-xml) into the db `abaevdict`, and the file `biblio/abaev_biblio.xml` into the db `abaevdict_index`.
|
||||||
|
|
||||||
|
4. Execute the script `scripts/update-indices.bxs` from the GUI or CLI. This does the following things:
|
||||||
|
- optimizes `abaevdict`;
|
||||||
|
- imports language data from the CSV file;
|
||||||
|
- creates the lookup table for entries;
|
||||||
|
- generates the English and Russian XML in `abaevdict_en` and `abaevdict_ru` (most resource-heavy and time-consuming);
|
||||||
|
- generates the HTML, so that it doesn't have to be done on-the-fly in most cases;
|
||||||
|
- optimizes `abaevdict_en`, `abaevdict_ru`;
|
||||||
|
- creates the indices for foreign-languages mentioned words in `abaevdict_index`;
|
||||||
|
- optimizes `abaevdict_index`.
|
||||||
|
|
||||||
|
Full execution of these actions takes a while, but it doesn't need to be redone unless the database changes; in the latter case, you can get away with regenerating only individual entries, although this has to be done manually for now
|
||||||
|
|
||||||
|
5. Run the BaseX http server (`basexhttp`). It will provide all services at `http://localhost:8080` by default.
|
||||||
|
|
16
WEB-INF/jetty.xml
Normal file
16
WEB-INF/jetty.xml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
|
||||||
|
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||||
|
<!-- Default connector. The Jetty stop port can be specified
|
||||||
|
in the .basex or pom.xml configuration file. -->
|
||||||
|
<Call name="addConnector">
|
||||||
|
<Arg>
|
||||||
|
<New class="org.eclipse.jetty.server.ServerConnector">
|
||||||
|
<Arg name="server"><Ref refid="Server"/></Arg>
|
||||||
|
<Set name="host">0.0.0.0</Set>
|
||||||
|
<Set name="port">8080</Set>
|
||||||
|
<Set name="idleTimeout">60000</Set>
|
||||||
|
<Set name="reuseAddress">true</Set>
|
||||||
|
</New>
|
||||||
|
</Arg>
|
||||||
|
</Call>
|
||||||
|
</Configure>
|
69
WEB-INF/web.xml
Normal file
69
WEB-INF/web.xml
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="4.0">
|
||||||
|
<display-name>BaseX: The XML Database and XQuery Processor</display-name>
|
||||||
|
<description>HTTP Services</description>
|
||||||
|
|
||||||
|
<!-- Global session and servlet listener -->
|
||||||
|
<listener>
|
||||||
|
<listener-class>org.basex.http.SessionListener</listener-class>
|
||||||
|
<listener-class>org.basex.http.ServletListener</listener-class>
|
||||||
|
</listener>
|
||||||
|
|
||||||
|
<!-- RESTXQ Service (can be disabled by removing this entry) -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>RESTXQ</servlet-name>
|
||||||
|
<servlet-class>org.basex.http.restxq.RestXqServlet</servlet-class>
|
||||||
|
<init-param>
|
||||||
|
<param-name>org.basex.user</param-name>
|
||||||
|
<param-value>admin</param-value>
|
||||||
|
</init-param>
|
||||||
|
<load-on-startup>1</load-on-startup>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>RESTXQ</servlet-name>
|
||||||
|
<url-pattern>/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<!-- WebSocket Service (can be disabled by removing this entry) -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>WebSocket</servlet-name>
|
||||||
|
<servlet-class>org.basex.http.ws.WsServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>WebSocket</servlet-name>
|
||||||
|
<url-pattern>/ws/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<!-- REST Service (can be disabled by removing this entry) -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>REST</servlet-name>
|
||||||
|
<servlet-class>org.basex.http.rest.RESTServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>REST</servlet-name>
|
||||||
|
<url-pattern>/rest/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<!-- WebDAV Service (can be disabled by removing this entry) -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>WebDAV</servlet-name>
|
||||||
|
<servlet-class>org.basex.http.webdav.WebDAVServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>WebDAV</servlet-name>
|
||||||
|
<url-pattern>/webdav/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<!-- Mapping for static resources (may be restricted to a sub path) -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>default</servlet-name>
|
||||||
|
<init-param>
|
||||||
|
<param-name>useFileMappedBuffer</param-name>
|
||||||
|
<param-value>false</param-value>
|
||||||
|
</init-param>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>default</servlet-name>
|
||||||
|
<url-pattern>/static/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
</web-app>
|
383
csv/langnames.csv
Normal file
383
csv/langnames.csv
Normal file
|
@ -0,0 +1,383 @@
|
||||||
|
code,glottolog,ru,en,en_abbr,family,genus,comment,lat,long,
|
||||||
|
ab,abkh1244,абх.,Abkhaz,Abkh.,NW Caucasian,NW Caucasian,,43.056218,41.159115,
|
||||||
|
abq,abaz1241,абаз.,Abaza,Abaza,NW Caucasian,NW Caucasian,,44.25,42.0,
|
||||||
|
abq-x-dial,abaz1241,абаз. (диал.),Abaza (dialectal),Abaza (dial.),NW Caucasian,NW Caucasian,,44.25,42.0,
|
||||||
|
ady,adyg1241,адыг.,Adyghe,Adyghe,NW Caucasian,NW Caucasian,,44.0,39.33,
|
||||||
|
ady-x-abadz,abad1240,абадз.,Abzakh Adyghe,Abzakh,NW Caucasian,NW Caucasian,coordinates of Khakurinokhabl,45.02,40.23,
|
||||||
|
ady-x-shpsg,shap1240,шапс.,Shapsug Adyghe,Shaps.,NW Caucasian,NW Caucasian,coordinates of Lazarevskoe,43.911111,39.338056,
|
||||||
|
ae,aves1237,ав.,Avestan,Av.,Indo-European,Iranian,,34.217,62.112,
|
||||||
|
ae-x-gth,aves1237,ав. (гаты),Gathic Avestan,GAv.,Indo-European,Iranian,,34.217,62.112,
|
||||||
|
aer,aran1263,аранта,Arrernte,Arrernte,Pama-Nyungan,Central Pama-Nyungan,coordinates of E. Arrernte,-23.36,135.05,
|
||||||
|
agx,aghu1253,агул.,Aghul,Agh.,NE Caucasian,Lezgic,,41.9242,47.5843,
|
||||||
|
aii,assy1241,ассир.,Assyrian,Assyr.,Afro-Asiatic,Semitic,,36.75,43.0,
|
||||||
|
ain,ainu1252,айну,Ainu,Ainu,Ainu,Ainu,I assume this is Japanese Ainu; coordinates of Hokkaido Ainu,43.63,142.46,
|
||||||
|
akk,akka1240,аккад.,Akkadian,Akk.,Afro-Asiatic,Semitic,,33.1,44.1,
|
||||||
|
akv,akhv1239,ахвах.,Akhvakh,Akhv.,NE Caucasian,Avar-Andic-Tsezic,,42.4003,46.3037,
|
||||||
|
alt,sout2694,алт.,Altai,Alt.,Altaic,Turkic,,50.1347,86.8705,
|
||||||
|
alt-x-teleut,tele1257,телеут.,Teleut Altai,Teleut,Altaic,Turkic,coordinates of Chelukhoevo,54.3672,86.2156,
|
||||||
|
ang,olde1238,англос.,Old English,OEng.,Indo-European,Germanic,,51.06,-1.31,
|
||||||
|
ani,andi1255,анд.,Andi,Andi,NE Caucasian,Avar-Andic-Tsezic,,42.8078,46.2919,
|
||||||
|
aqc,arch1244,арчин.,Archi,Archi,NE Caucasian,Lezgic,,42.3239,46.8267,
|
||||||
|
ar,stan1318,араб.,Arabic,Ar.,Afro-Asiatic,Semitic,,27.9625,43.8525,
|
||||||
|
arc,impe1235,арам.,Aramaic,Aram.,Afro-Asiatic,Semitic,,33.905,42.185,
|
||||||
|
av,avar1256,авар.,Avar,Avar,NE Caucasian,Avar-Andic-Tsezic,,41.7047,46.558,
|
||||||
|
az,mode1262,азерб.,Azerbaijani,Az.,Altaic,Turkic,coordinates of North Azerbaijani,40.98,46.47,
|
||||||
|
ba,bash1264,башк.,Bashkir,Bashk.,Altaic,Turkic,,53.59671,56.55937,
|
||||||
|
bat,east2280,балт.,Baltic,Balt.,Indo-European,Baltic,coordinates of Lithuanian,55.14,23.96,
|
||||||
|
bbl,bats1242,туш.,Bats,Bats,NE Caucasian,Nakh,,42.1806,45.344,
|
||||||
|
bdk,budu1248,будух.,Budugh,Bud.,NE Caucasian,Lezgic,,41.2272,48.3353,
|
||||||
|
be,bela1254,белорусс.,Belarusian,Bel.,Indo-European,Slavic,,53.2307,25.6038,
|
||||||
|
bg,bulg1262,болг.,Bulgarian,Bulg.,Indo-European,Slavic,,43.3646,25.047,
|
||||||
|
bgn,west2368,бел. (зап.),Western Balochi,WBal.,Indo-European,Iranian,,37.83,62.17,
|
||||||
|
bgp,east2304,бел. (вост.),Eastern Balochi,EBal.,Indo-European,Iranian,,28.0,62.0,
|
||||||
|
bn,beng1280,бенгали,Bengali,Beng.,Indo-European,Indic,,24.00,90.00,
|
||||||
|
bo,tibe1272,тибет.,Tibetan,Tib.,Sino-Tibetan,Bodic,,28.3681,90.1872,
|
||||||
|
bph,botl1242,ботл.,Botlikh,Botl.,NE Caucasian,Avar-Andic-Tsezic,,42.665,46.22,
|
||||||
|
bqi,bakh1245,перс. (бахтиар.),Persian (Bakhtiari),Pers. (Bakht.),Indo-European,Iranian,,32.02,49.77,
|
||||||
|
br,bret1244,брет.,Breton,Bret.,Indo-European,Celtic,,48.2452,-3.78934,
|
||||||
|
brh,brah1256,брахуи,Brahui,Brah.,Dravidian,Dravidian,,29.04,66.56,
|
||||||
|
bsg,bash1263,башкарди,Bashkardi,Bashkardi,Indo-European,Iranian,,32.00,53.00,
|
||||||
|
bsk,buru1296,верш.,Burushaski,Burush.,Burushaski,Burushaski,,36.2161,74.8236,
|
||||||
|
bua,buri1258,монг. бурят.,Buryat,Buryat,Altaic,Mongolic,coordinates of Russia Buriat,50.85,105.56,
|
||||||
|
cau,0,кавк.,Caucasian,Cauc.,0,0,coordinates of the Caucasus (wiki),42.261111,44.121111,
|
||||||
|
ccs,kart1248,картв.,South Caucasian,SCauc.,Kartvelian,Kartvelian,coordinates of Georgian,41.85,43.79,
|
||||||
|
ce,chec1245,чеч.,Chechen,Chech.,NE Caucasian,Nakh,,43.5,45.5,
|
||||||
|
ce-x-goyt,chec1245,чеч. (гойт.),Chechen (Ghoyta),Chech. (Ghoyta),NE Caucasian,Nakh,,43.164167,45.622222,
|
||||||
|
ce-x-achkh,chec1245,чеч. (ачхой-март.),Chechen (Achkhoy-Martan),Chech. (Achkhoy-Martan),NE Caucasian,Nakh,,43.189167,45.284722,
|
||||||
|
cel,celt1248,кельт.,Celtic,Celt.,Indo-European,Celtic,coordinates of Breton,48.25,-3.79,
|
||||||
|
chg,chag1247,чагат.,Chagatai,Chag.,Altaic,Turkic,,38.21146,57.88758,
|
||||||
|
chm,mari1278,мар.,Mari,Mari,Uralic,Mari,coordinates of Mari El,56.52,46.252,
|
||||||
|
cji,cham1309,чамал.,Chamalal,Cham.,NE Caucasian,Avar-Andic-Tsezic,,42.5024,45.995,
|
||||||
|
cjs,shor1247,шор.,Shor,Shor,Altaic,Turkic,,52.32607,88.4344,
|
||||||
|
ckb,cent1972,сорани,Sorani,Sor.,Indo-European,Iranian,,35.6539,45.8077,
|
||||||
|
ckb-x-kndln,cent1972,кандулан,Sorani (Kandulan),Kandulan,Indo-European,Iranian,I assume this is Sorani; add coordinates?,35.6539,45.8077,
|
||||||
|
cmg,halh1238,монг. письм.,Classical Mongolian,Cl. Mong.,Altaic,Mongolic,,48.32397,106.28874,
|
||||||
|
crh,crim1257,татар. (крым.),Crimean Tatar,Crim. Tat.,Altaic,Turkic,,45.0,34.08,
|
||||||
|
cs,czec1258,чеш.,Czech,Cz.,Indo-European,Slavic,,49.873398,15.10437,
|
||||||
|
cu,chur1257,ст.слав.,Old Church Slavonic,OCS,Indo-European,Slavic,,43.7171,22.8442,
|
||||||
|
cu-x-bg,chur1257,др.болг.,Old Bulgarian,OBulg.,Indo-European,Slavic,add coordinates,43.7171,22.8442,
|
||||||
|
cv,chuv1255,чув.,Chuvash,Chuv.,Altaic,Turkic,,55.48701,47.16298,
|
||||||
|
cy,wels1247,валл.,Welsh,Welsh,Indo-European,Celtic,,52.0,-4.0,
|
||||||
|
cy-x-cymr,wels1247,кимр.,Cymric,Cymr.,Indo-European,Celtic,might be Old Welsh?,52.0,-4.0,
|
||||||
|
da,dani1285,дат.,Danish,Dan.,Indo-European,Germanic,,54.8655,9.36284,
|
||||||
|
da-x-old,oldd1239,стародат.,Old Danish,ODan.,Indo-European,Germanic,,54.8655,9.36284,
|
||||||
|
dar,darg1242,дарг.,Dargwa,Darg.,NE Caucasian,Dargwic,coordinates of Aqusha,42.2665,47.3439,
|
||||||
|
dar-x-aqusha,akus1238,акуш.,Aqusha Dargwa,Aq.,NE Caucasian,Dargwic,,42.2665,47.3439,
|
||||||
|
dar-x-kaitag,kajt1238,кайт.,Kaitag Dargwa,Kait.,NE Caucasian,Dargwic,,42.052428,47.776611,
|
||||||
|
ddo,dido1241,дид.,Tsez,Tsez,NE Caucasian,Avar-Andic-Tsezic,,42.2646,45.8096,
|
||||||
|
de,stan1295,нем.,German,Ger.,Indo-European,Germanic,,48.649,12.4676,
|
||||||
|
de-x-dial,mode1258,нем. (диал.),German (dialectal),Ger. (dial.),Indo-European,Germanic,for Glottolog I assume it is High German because the dialects belong to distinct branches,48.649,12.4676,
|
||||||
|
de-x-south,mode1258,южнонем.,Southern German,SGer.,Indo-European,Germanic,coordinates of Bavarian,47.92,13.25,
|
||||||
|
dsb,lowe1385,нижне-луж.,Lower Sorbian,LSorb.,Indo-European,Slavic,,51.6621,13.9407,
|
||||||
|
ecr,eteo1236,крит.,Cretan,Cret.,Eteocretan,Eteocretan,I assume it is Eteocretan,35.21,24.91,
|
||||||
|
egy,egyp1246,древнеегипетский,Ancient Egyptian,Eg.,Afro-Asiatic,Egyptian-Coptic,,28.381735,30.834959,
|
||||||
|
el,mode1248,н.гр.,Modern Greek,Mod. Gr.,Indo-European,Greek,,38.36,23.13,
|
||||||
|
elx,elam1244,элам.,Elamite,El.,Elamite,Elamite,,31.1833,48.2333,
|
||||||
|
en,stan1293,англ.,English,Eng.,Indo-European,Germanic,,53.0,-1.0,
|
||||||
|
en-x-argt,stan1293,англ. (арго),English (slang),Eng. (sl.),Indo-European,Germanic,,53.0,-1.0,
|
||||||
|
es,stan1288,исп.,Spanish,Sp.,Indo-European,Romance,,40.4414,-1.11788,
|
||||||
|
et,esto1258,эст.,Estonian,Est.,Uralic,Finnic,,58.55,25.82,
|
||||||
|
ett,etru1241,этр.,Etruscan,Etr.,Etruscan,Etruscan,,41.90,12.48,
|
||||||
|
eu,basq1248,баск.,Basque,Bsq.,Basque,Basque,,43.2787,-1.31622,
|
||||||
|
evn,even1259,эвенк.,Evenki,Evenki,Altaic,Tungusic,,61.972,94.689,
|
||||||
|
fa,fars1255,перс.,Persian,Pers.,Indo-European,Iranian,coordinates of Western Farsi,32.90,53.30,
|
||||||
|
fa-x-dial,fars1255,перс. (диал.),Persian (dialectal),Pers. (dial.),Indo-European,Iranian,coordinates of Western Farsi,32.90,53.30,
|
||||||
|
fa-x-fars,fars1256,перс. (диалект Фарси),Persian (Fars),Pers. (Fars),Indo-European,Iranian,,29.62,52.53,
|
||||||
|
fa-x-kshn,fars1255,перс. (кашан.),Persian (Kashan),Pers. (Kashan),Indo-European,Iranian,I assume this is the local dialect of Persian rather than the NW Iranian language of Kashan,33.99,51.48,
|
||||||
|
fa-x-krmns,kerm1248,перс. (кирманшах.),Persian (Kermanshah),Pers. (Kerm.),Indo-European,Iranian,,34.314167,47.065,
|
||||||
|
fi,finn1318,фин.,Finnish,Fin.,Uralic,Finnic,,64.7628,25.5577,
|
||||||
|
fi-x-dial,finn1318,фин. (диал.),Finnish (dialectal),Fin. (dial.),Uralic,Finnic,,64.7628,25.5577,
|
||||||
|
fr,stan1290,фр.,French,Fr.,Indo-European,Romance,,48.0,2.0,
|
||||||
|
fro,oldf1239,ст.фр.,Old French,OFr.,Indo-European,Romance,,48.8,1.11,
|
||||||
|
frp,fran1260,фр. (прованс.),Franco-Provençal,Fr.-Prov.,Indo-European,Romance,,45.8051,6.48152,
|
||||||
|
frs,sate1242,фриз. (вост.),East Frisian,EFris.,Indo-European,Germanic,,53.117,7.721,
|
||||||
|
fy,fris1239,фриз.,Frisian,Fris.,Indo-European,Germanic,"chose West as the largest branch, but not certain",53.14,5.86,
|
||||||
|
ga,iris1253,ирл.,Irish,Irish,Indo-European,Celtic,,53.2186,-7.61509,
|
||||||
|
gbz,gabr1257,габри,Zoroastrian Dari,Zor. Dari,Indo-European,Iranian,,31.82,54.45,
|
||||||
|
gbz-x-yzd,zoro1242,язди,Yazdi,Yazdi,Indo-European,Iranian,,31.8161,54.4469,
|
||||||
|
gdo,ghod1238,годобер.,Godoberi,Godob.,NE Caucasian,Avar-Andic-Tsezic,,42.7428,46.2252,
|
||||||
|
gem,germ1287,герм.,Germanic,Germ.,Indo-European,Germanic,coordinates of Ostfränkisch: roughly at the middle of the are of Modern Germanic,50.01,8.62,
|
||||||
|
gem-x-old,germ1287,др.герм.,Old Germanic,OGerm.,Indo-European,Germanic,,-99,-99,
|
||||||
|
glk,gila1241,гилян.,Gilaki,GIl.,Indo-European,Iranian,,37.1344,49.8359,
|
||||||
|
gmh,midd1343,ср.в.нем.,Middle High German,MHG,Indo-European,Germanic,,48.254,10.599,
|
||||||
|
gml,midd1318,ср.н.нем.,Middle Low German,MLG,Indo-European,Germanic,,53.14,9.67,
|
||||||
|
gmq,nort3160,сканд.,Scandinavian,NGerm.,Indo-European,Germanic,rarely used,63.42,10.38, coordinates of Old Norse
|
||||||
|
goh,oldh1241,др.в.нем.,Old High German,OHG,Indo-European,Germanic,,52.0,10.0,
|
||||||
|
got,goth1244,гот.,Gothic,Goth.,Indo-European,Germanic,,46.9304,29.9786,
|
||||||
|
got-x-crm,crim1255,гот. (крым.),Crimean Gothic,Crim. Goth.,Indo-European,Germanic,,45.3,34.4,
|
||||||
|
grc,anci1242,гр.,Greek,Gr.,Indo-European,Greek,,39.8155,21.9129,
|
||||||
|
grc-x-byz,midd1362,гр. (визант.),Byzantine Greek,Byz. Gr.,Indo-European,Greek,coordinates of Istanbul,41.013611,28.955,
|
||||||
|
grc-x-doric,dori1248,гр. дор.,Doric Greek,Dor. Gr.,Indo-European,Greek,coordinates of Greek Epirus,39.6,20.8,
|
||||||
|
grc-x-hom,anci1242,гр. (Гомер),Homeric Greek,Hom. Gr.,Indo-European,Greek,coordinates of Ephesus,37.95,27.366667,
|
||||||
|
ha,haus1257,хауса,Hausa,Hausa,Afro-Asiatic,West Chadic,,11.15,8.78,
|
||||||
|
hac,gura1251,гуран.,Gorani,Gor.,Indo-European,Iranian,,36.8377,44.4956,
|
||||||
|
hbo,anci1244,др.евр.,Hebrew,Heb.,Afro-Asiatic,Semitic,,31.7761,35.1725,
|
||||||
|
hi,hind1269,хинди,Hindi,Hindi,Indo-European,Indic,,25.0,77.0,
|
||||||
|
hit,hitt1242,хетт.,Hittite,Hitt.,Indo-European,Anatolian,,40.0,35.0,
|
||||||
|
hr,croa1245,хорв.,Croatian,Croat.,Indo-European,Slavic,,45.555,15.982,
|
||||||
|
hsb,uppe1395,верхнелуж.,Upper Sorbian,USorb.,Indo-European,Slavic,,51.24,14.41,
|
||||||
|
hu,hung1274,венг.,Hungarian,Hung.,Uralic,Ugric,,46.9068585714,19.6555271429,
|
||||||
|
huz,hunz1247,гунзиб.,Hunzib,Hunz.,NE Caucasian,Avar-Andic-Tsezic,,42.0808,46.1369,
|
||||||
|
iir,indo1320,ар.,Aryan,Ar.,Indo-European,0,,-99,-99,
|
||||||
|
inc,indo1321,инд.,Indo-Aryan,IA,Indo-European,Indic,coordinates of country India,21,78,
|
||||||
|
inc-x-mid,midd1375,ср.инд.,Middle Indic,MInd.,Indo-European,Indic,coordinates of country India,21,78,
|
||||||
|
inc-x-nnew,indo1324,северные новоиндийские диалекты,North New Indic dialects,North New Indic dialects,Indo-European,Indic,coordinates of Delhi,28.61,77.23,
|
||||||
|
inc-x-old,sans1269,др.инд.,Old Indic,OInd.,Indo-European,Indic,,20.0,77.0,
|
||||||
|
ine,indo1319,и.е.,Indo-European,IE,Indo-European,0,,-99,-99,
|
||||||
|
inh,ingu1240,инг.,Ingush,Ing.,NE Caucasian,Nakh,,43.11,45.03,
|
||||||
|
ira,iran1269,иран.,Iranian,Ir.,Indo-European,Iranian,,-99,-99,
|
||||||
|
ira-x-mid,iran1269,ср.иран.,Middle Iranian,MIr.,Indo-European,Iranian,,-99,-99,
|
||||||
|
is,icel1247,исл.,Icelandic,Icel.,Indo-European,Germanic,,63.4837,-19.0212,
|
||||||
|
isk,ishk1246,пам. ишк.,Ishkashimi,Ishk.,Indo-European,Iranian,,36.67,71.55,
|
||||||
|
it,ital1282,ит.,Italian,It.,Indo-European,Romance,,43.0464,12.6489,
|
||||||
|
ja,nucl1643,япон.,Japanese,Jap.,Japanese,Japanese,,35.0,135.0,
|
||||||
|
ka,nucl1302,груз.,Georgian,Georg.,Kartvelian,Kartvelian,,41.850397,43.78613,
|
||||||
|
ka-x-clq,nucl1302,груз. (разг.),Georgian (colloquial),Georg. (col.),Kartvelian,Kartvelian,,41.850397,43.78613,
|
||||||
|
ka-x-dial,nucl1302,груз. (диал.),Georgian (dialectal),Georg. (dial.),Kartvelian,Kartvelian,,41.850397,43.78613,
|
||||||
|
ka-x-guria,guri1246,груз. (гур.),Gurian Georgian,Georg. (Gur.),Kartvelian,Kartvelian,,41.966667,42.2,
|
||||||
|
ka-x-imer,imer1248,груз. (имер.),Imeretian Georgian,Georg. (Imer.),Kartvelian,Kartvelian,,42.166667,42.983333,
|
||||||
|
ka-x-ingiloy,ingi1240,груз. (ингил.),Ingiloy Georgian,Georg. (Ing.),Kartvelian,Kartvelian,coordinates of Zaqatala,41.633611,46.643333,
|
||||||
|
ka-x-khevsur,xevs1238,груз. (хевсур.),Khevsur Georgian,Georg. (Khev.),Kartvelian,Kartvelian,,42.4883,44.87915,
|
||||||
|
ka-x-lchkhm,rach1238,груз. (лечхум.),Lechkhumi Georgian,Georg. (Lech.),Kartvelian,Kartvelian,,42.649722,42.759722,
|
||||||
|
ka-x-mokhev,moxe1238,груз. (мохев.),Mokhevian Georgian,Georg. (Mokh.),Kartvelian,Kartvelian,coordinates of Khevi,42.6975,44.519,
|
||||||
|
ka-x-mtiul,mtiu1238,груз. (мтиул.),Mtiuletian Georgian,Georg. (Mtiul.),Kartvelian,Kartvelian,coordinates of Pasanauri,42.346389,44.692778,
|
||||||
|
ka-x-pshav,psha1238,груз. (пшав.),Pshavian Georgian,Georg. (Pshav.),Kartvelian,Kartvelian,,42.283333,44.75,
|
||||||
|
ka-x-rachian,rach1238,груз. (рачин.),Rachian Georgian,Georg. (Rach.),Kartvelian,Kartvelian,,42.636111,43.436111,
|
||||||
|
kaa,kara1467,каракалп.,Kara-Kalpak,Kara-Kalp.,Altaic,Turkic,,39.98005,63.32233,
|
||||||
|
xas,kama1351,камас.,Kamas,Kamas,Uralic,Samoyedic,,55.07,94.83,
|
||||||
|
kap,bezh1248,капуч.,Bezhta,Bezhta,NE Caucasian,Avar-Andic-Tsezic,,42.1206,46.0332,
|
||||||
|
kbd,kaba1278,каб.,Kabardian,Kab.,NW Caucasian,NW Caucasian,,43.5082,43.3918,
|
||||||
|
kbd-x-crc,kaba1278,черк.,Circassian,Circ.,NW Caucasian,NW Caucasian,add coordinates to distinguish Kabardian and Circassian?,43.5082,43.3918,
|
||||||
|
kbd-x-crc-dial,kaba1278,черк. (диал.),Circassian (dialectal),Circ. (dial.),NW Caucasian,NW Caucasian,,43.5082,43.3918,
|
||||||
|
kbd-x-crc-west,kaba1278,черк. (зап.),Circassian (western),Circ. (W.),NW Caucasian,NW Caucasian,probably distinct from West Circassian (= Adyghe),43.5082,43.3918,
|
||||||
|
kbd-x-dial,kaba1278,каб. (диал.),Kabardian (dialectal),Kab. (dial.),NW Caucasian,NW Caucasian,,43.5082,43.3918,
|
||||||
|
kca,khan1279,ханты,Khanty,Khanty,Uralic,Ugric,coordinates of Kazym Khanty,62.43,66.12,
|
||||||
|
kdr,kara1464,караим.,Karaim,Kar.,Altaic,Turkic,,54.5534,25.1054,
|
||||||
|
kho,khot1251,сак.,Saka,Saka,Indo-European,Iranian,,38.33,79.04,
|
||||||
|
khv,xvar1237,хварш.,Khwarshi,Khwarshi,NE Caucasian,Avar-Andic-Tsezic,,42.27,46.00,
|
||||||
|
khw,khow1242,ховар.,Khowar,Khow.,Indo-European,Indic,,36.0,72.0,
|
||||||
|
khw-x-chtr,sout2670,читр.,Khowar (Chitral),Khow. (Chitral),Indo-European,Indic,"I assume this is Khowar, the language spoken in Chitral in Pakistan. For Glottolog I assume it’s southern Khowar, but this is preliminary",35.846111,71.785833,
|
||||||
|
kjh,khak1248,хакас.,Khakas,Khak.,Altaic,Turkic,coordinates of Askiz (the Glottolog coordinates may be a mistake),53.1283,90.538,
|
||||||
|
kjh-sghy,saga1260,хакас. (сагайск.),Saghay Khakas,Khak. (Saghay),Altaic,Turkic,,53.1283,90.538,
|
||||||
|
kjj,khin1240,хиналуг.,Khinalugh,Khin.,NE Caucasian,Khinalug,,41.1801,48.0571,
|
||||||
|
kk,kaza1248,каз.,Kazakh,Kaz.,Altaic,Turkic,,51.17,71.45,
|
||||||
|
kk-x-krgnd,kaza1248,караг.,Qaraghandy Kazakh,Qaragh.,Altaic,Turkic,coordinates of Karaganda,49.7931,73.1168,
|
||||||
|
ko,kore1280,кор.,Korean,Kor.,Korean,Korean,,37.54,126.98,
|
||||||
|
kpt,kara1516,карат.,Karata,Karata,NE Caucasian,Avar-Andic-Tsezic,,42.65,46.32,
|
||||||
|
krc-x-balkar,balk1253,балк.,Balkar,Balk.,Altaic,Turkic,coordinates of Tyrnyauz,43.3815,42.9188,
|
||||||
|
krc-x-karachay,kara1466,карач.,Karachay,Karach.,Altaic,Turkic,coordinates of Karachaevsk,43.762,41.9664,
|
||||||
|
krl,kare1335,карел.,Karelian,Karel.,Uralic,Finnic,,65.1691,30.8655,
|
||||||
|
kry,kryt1240,крыз.,Kryz,Kryz,NE Caucasian,Lezgic,,41.1811,48.1846,
|
||||||
|
kry-x-jek,dzhe1238,джекск.,Jek Kryz,Jek,NE Caucasian,Lezgic,,41.195,48.2417,
|
||||||
|
ku,kurd1259,курд.,Kurdish,Kurd.,Indo-European,Iranian,coordinates of Kurmanji,37.00,43.00,
|
||||||
|
kum,kumy1244,кум.,Kumyk,Kum.,Altaic,Turkic,,43.0,47.0,
|
||||||
|
kv,komi1267,коми,Komi,Komi,Uralic,Permic,coordinates of Zyrian,64.05,54.95,
|
||||||
|
kva,bagv1239,куанад.,Bagvalal,Bagv.,NE Caucasian,Avar-Andic-Tsezic,,42.40,46.10,
|
||||||
|
kw,corn1251,корн.,Cornish,Corn.,Indo-European,Celtic,,50.5233,-4.18619,
|
||||||
|
ky,kirg1245,кирг.,Kyrgyz,Kyrg.,Altaic,Turkic,,42.0,74.0,
|
||||||
|
la,lati1261,лат.,Latin,Lat.,Indo-European,Romance,,41.9026,12.4502,
|
||||||
|
lah,west2386,ланда,Lahnda,Lahnda,Indo-European,Indic,,30.09,75.35,
|
||||||
|
la-x-late,late1252,позднелат.,Late Latin,Late Lat.,Indo-European,Romance,,41.9026,12.4502,
|
||||||
|
lbe,lakk1252,лак.,Lak,Lak,NE Caucasian,Lak,,42.1328,47.0809,
|
||||||
|
ldd,luri1256,лур.,Luri,Luri,Indo-European,Iranian,,10.059,9.59745,
|
||||||
|
lez,lezg1247,лезг.,Lezgian,Lezg.,NE Caucasian,Lezgic,,41.5157,47.8951,
|
||||||
|
liv,livv1244,лив.,Livonian,Liv.,Indo-European,Baltic,,57.566,22.0262,
|
||||||
|
lrl,lari1253,лар.,Lari,Lari,Indo-European,Iranian,Glottolog Larestani,27.64,54.63,
|
||||||
|
lt,lith1251,лит.,Lithuanian,Lit.,Indo-European,Baltic,,55.1429,23.9601,
|
||||||
|
lt-x-dial,lith1251,лит. (диал.),Lithuanian (dialectal),Lit. (dial.),Indo-European,Baltic,,55.1429,23.9601,
|
||||||
|
lv,latv1249,латыш.,Latvian,Latv.,Indo-European,Baltic,,56.826108,24.309118,
|
||||||
|
lzz,lazz1240,чан.,Laz,Laz,Kartvelian,Kartvelian,,41.5004,41.9096,
|
||||||
|
man,mand1436,мандинго,Manding,Mand.,Mande,Western Mande,I assume this is Mandinka and not Manding in general,12.8165233333,-15.6539466667,
|
||||||
|
mdf,moks1248,мордовский (мокша),Moksha Mordvin,Moksha,Uralic,Mordvin,,54.1855,42.6728,
|
||||||
|
mga,midd1360,ср.ирл.,Middle Irish,MIr.,Indo-European,Celtic,,53.22,-7.62,
|
||||||
|
mis-x-khuri,khur1237,хури,Khuri,Khuri,Indo-European,Iranian,https://www.iranicaonline.org/articles/khur-oasis,33.78333333333333,55.083333333333336,
|
||||||
|
mn,mong1331,монг.,Mongolian,Mong.,Altaic,Mongolic,coordinates of Halh,48.32,106.29,
|
||||||
|
mn-x-uriankh,alta1280,урянх.,Uriankhai,Uriankh.,Altaic,Mongolic,seems to be Altai Uriankhai,48.2857,89.5001,
|
||||||
|
mnc,manc1252,манджурское,Manchu,Manchu,Altaic,Tungusic,,47.31225,126.55713,
|
||||||
|
mnj,munj1244,пам. м.,Munji,Munji,Indo-European,Iranian,,35.9321,70.9404,
|
||||||
|
mns,mans1269,манси,Mansi,Mansi,Uralic,Ugric, = вогул.,61.14,62.40,
|
||||||
|
mr,mara1378,маратхи,Marathi,Marathi,Indo-European,Indic,,17.93,76.67,
|
||||||
|
myv,erzy1239,мордовский (эрзя),Erzya Mordvin,Erzya,Uralic,Mordvin,,52.8548,45.3901,
|
||||||
|
mzn,maza1291,маз.,Mazanderani,Mazand.,Indo-European,Iranian,,36.241,52.3009,
|
||||||
|
nds,nort2627,н.н.нем.,Low German,LGer.,Indo-European,Germanic,,53.115373,12.391439,
|
||||||
|
ne,nepa1254,непал.,Nepali,Nep.,Indo-European,Indic,used macrolanguage because it’s not clear what exactly Abaev refers to,28.0,85.0,
|
||||||
|
nl,dutc1256,нидерл.,Dutch,Dut.,Indo-European,Germanic,,52.0,5.0,
|
||||||
|
no,norw1258,норв.,Norwegian,Nor.,Indo-European,Germanic,,59.92,10.71,
|
||||||
|
no-x-dial,norw1258,норв. (диал.),Norwegian (dialectal),Nor. (dial.),Indo-European,Germanic,,59.92,10.71,
|
||||||
|
nog,noga1249,ног.,Nogai,Nog.,Altaic,Turkic,,44.89776,43.1656,
|
||||||
|
non,oldn1244,др.сев.,Old Norse,ONor.,Indo-European,Germanic,,63.42,10.38,
|
||||||
|
non-x-is,oldw1240,др.исл.,Old Icelandic,OIcel.,Indo-European,Germanic,indicate the coordinates of Icelandic specifically,63.48,-19.02,
|
||||||
|
ntz,nata1252,натанзи,Natanzi,Natanzi,Indo-European,Iranian,,33.4593,51.9538,
|
||||||
|
nub,oldn1245,нубийское,Nubian,Nub.,Eastern Sudanic,Nubian,I assume Abaev cites Old Nubian,18.760713,31.748657,
|
||||||
|
oc,occi1239,прованс.,Occitan,Occ.,Indo-European,Romance,probably Occitan; Abaev seems to call Franco-Provençal «фр. (прованс.)»,44.1415,6.82979,
|
||||||
|
ofs,oldf1241,др.фриз.,Old Frisian,OFris.,Indo-European,Germanic,,53.35,6.8,
|
||||||
|
oge,oldg1234,др.груз.,Old Georgian,OGeorg.,Kartvelian,Kartvelian,,41.604313,43.06151,
|
||||||
|
ohu,hung1274,ст.венг.,Old Hungarian,OHung.,Uralic,Ugric,,46.9068585714,19.6555271429,
|
||||||
|
oos,oldo1234,ст.ос.,Old Ossetic,OOss.,Indo-European,Iranian,,48.48,39.46,
|
||||||
|
oru,ormu1247,орм.,Ormuri,Orm.,Indo-European,Iranian,,32.6819,69.3444,
|
||||||
|
orv,oldr1238,др.русск.,Old Russian,ORus.,Indo-European,Slavic,,54.813,31.827,
|
||||||
|
os,osse1243,ос.,Ossetic,Oss.,Indo-European,Iranian,"I assume that when Abaev cites Ossetic, he cites modern Ossetic",42.98,44.61,
|
||||||
|
os-x-digor,digo1242,д.,Digor,Dig.,Indo-European,Iranian,,43.158056,44.156944,
|
||||||
|
os-x-iron,iron1242,и.,Iron,Iron,Indo-European,Iranian,,42.98,44.61,
|
||||||
|
os-x-ksan,iron1242,ксан.,Ksan Ossetic,Ksan.,Indo-European,Iranian,add coordinates,42.98,44.61,
|
||||||
|
os-x-south,iron1242,ю.,South Ossetic,SOss.,Indo-European,Iranian,add coordinates,42.98,44.61,
|
||||||
|
osx,olds1250,др.сакс.,Old Saxon,OSax.,Indo-European,Germanic,,52.37,9.72,
|
||||||
|
oui,oldu1238,др.тюрк.,Old Turkic,OTurk.,Altaic,Turkic,,42.85,89.53,
|
||||||
|
pa,panj1256,пенджаби,Punjabi,Punj.,Indo-European,Indic,arbitrarily chose Eastern Panjabi for Glottolog,30.0368,75.6702,
|
||||||
|
pal,pahl1241,пехл.,Middle Persian,MPers.,Indo-European,Iranian,,30.06,52.7,
|
||||||
|
pal-x-pazend,pahl1241,паз.,Pazend,Paz.,Indo-European,Iranian,,30.06,52.7,
|
||||||
|
pal-x-turfan,pahl1241,пехл. турф.,Turfan Pahlavi,Pahl. Turf.,Indo-European,Iranian,add coordinates,30.06,52.7,
|
||||||
|
paq,pary1242,парья,Parya,Parya,Indo-European,Indic,,36.49,69.26,
|
||||||
|
peo,oldp1254,др.перс.,Old Persian,OPers.,Indo-European,Iranian,,32.0,54.0,
|
||||||
|
pgd,gand1259,кхарошти,Gandhari,Gandh.,Indo-European,Indic,,34.15,71.73,
|
||||||
|
pi,pali1273,пали,Pali,Pali,Indo-European,Indic,,24.5271,82.251,
|
||||||
|
pl,poli1260,пол.,Polish,Pol.,Indo-European,Slavic,,51.8439,18.6255,
|
||||||
|
pl-x-old,oldp1256,старопол.,Old Polish,OPol.,Indo-European,Slavic,,51.8439,18.6255,
|
||||||
|
pox,pola1255,полабский,Polabian,Polab.,Indo-European,Slavic,,52.00,14.00,
|
||||||
|
pra,midd1350,пракрит.,Prakrit,Prakr.,Indo-European,Indic,Glottolog arbitrary,26.61,78.97,
|
||||||
|
prc,para1299,пар.,Parachi,Par.,Indo-European,Iranian,,36.0432,70.8805,
|
||||||
|
prg,prus1238,др.прусс.,Old Prussian,OPrus.,Indo-European,Germanic,,52.394,14.757,
|
||||||
|
prn,pras1239,прасунск.,Prasun,Pras.,Indo-European,Nuristani,,35.42,70.92,
|
||||||
|
prs,dari1249,тадж. (кабули),Dari (Kabul),Dari (Kab.),Indo-European,Iranian,,31.0405,67.3593,
|
||||||
|
ps,nucl1276,афг.,Pashto,Pashto,Indo-European,Iranian,I assign this to Nuclear Pashto in Glottolog because Wanetsi is separate,31.92,69.45,
|
||||||
|
psh,sout2671,пашан,Pashai (?),Pashai,Indo-European,Iranian,Glottolog arbitrary,34.8478,69.8734,
|
||||||
|
pt,port1283,порт.,Portuguese,Port.,Indo-European,Romance,,39.91,-8.10,
|
||||||
|
qwm,cuma1241,куман.,Cuman,Cum.,Altaic,Turkic,,45.00,34.08,
|
||||||
|
ro,roma1327,рум.,Romanian,Rom.,Indo-European,Romance,,46.3913,24.2256,
|
||||||
|
rom,roma1329,цыг.,Romani,Romani,Indo-European,Indic,arbitrarily chose Central Romani,48.20,20.31,
|
||||||
|
ru,russ1263,русск.,Russian,Rus.,Indo-European,Slavic,,59.0,50.0,
|
||||||
|
ru-x-argot,russ1263,русск. (арго),Russian (argot),Rus. (argot),Indo-European,Slavic,,59.0,50.0,
|
||||||
|
ru-x-arkh,pomo1275,русск. (арх.),Russian (Arkhangelsk),Rus. (Arkh.),Indo-European,Slavic,,63.5,43.0,
|
||||||
|
ru-x-astr,sout2602,русск. (астрах.),Russian (Astrakhan),Rus. (Astr.),Indo-European,Slavic,,46.35,48.035,
|
||||||
|
ru-x-dial,russ1263,русск. (диал.),Russian (dialectal),Rus. (dial.),Indo-European,Slavic,,59.0,50.0,
|
||||||
|
ru-x-don,sout2602,русск. (донской говор),Russian (Don variety),Rus. (Don),Indo-European,Slavic,Novocherkassk,47.422222,40.093889,
|
||||||
|
ru-x-kstr,nort2597,русск. (кстр.),Russian (Kostroma),Rus. (Kostr.),Indo-European,Slavic,,57.768056,40.926944,
|
||||||
|
ru-x-novg,novg1241,русск. (новг.),Russian (Novgorod),Rus. (Novg.),Indo-European,Slavic,,58.433333,32.383333 ,
|
||||||
|
ru-x-sib,russ1263,русск. (сиб.),Russian (Siberian),Rus. (Sib.),Indo-European,Slavic,coordinates of Krasnoyarsk,56.0062,92.8712,
|
||||||
|
ru-x-smlnsk,russ1263,русск. (смол.),Russian (Smolensk),Rus. (Smol.),Indo-European,Slavic,add coordinates,59.0,50.0,
|
||||||
|
ru-x-south,sout2602,русск. (южн. диал.),Russian (southern dialects),Rus. (s.),Indo-European,Slavic,,45.05,41.983333 ,
|
||||||
|
ru-x-tvr,cent2343,русск. (твер.),Russian (Tver),Rus. (Tv.),Indo-European,Slavic,,56.8625,35.924167,
|
||||||
|
ru-x-vldmr,vlad1234,русск. (влад.),Russian (Vladimir),Rus. (Vlad.),Indo-European,Slavic,,56.083333,40.616667,
|
||||||
|
ru-x-west,russ1263,русск. (зап. диал.),Russian (Western dialects),Rus. (w.),Indo-European,Slavic,coordinates of Smolensk,54.782778,32.045278,
|
||||||
|
rut,rutu1240,рутул.,Rutul,Rut.,NE Caucasian,Lezgic,,41.6187,47.3244,
|
||||||
|
sa,clas1258,скр.,Sanskrit,Sanskr.,Indo-European,Indic,,20.0,77.0,
|
||||||
|
sa-bauddha,budd1234,др.инд. (будд.),Buddhist Sanskrit,Sanskr. (Bud.),Indo-European,Indic,coordinates of Pali,24.53,82.25,
|
||||||
|
sa-vaidika,vedi1234,вед.,Vedic,Ved.,Indo-European,Indic,,20.0,77.0,
|
||||||
|
sah,yaku1245,якут.,Yakut,Yak.,Altaic,Turkic,,61.69744,133.98031,
|
||||||
|
sbv,sabi1245,саб.,Sabine,Sab.,Indo-European,Italic,,43.54,13.46,
|
||||||
|
sel,selk1253,селькуп.,Selkup,Selk.,Uralic,Samoyedic,,59.94,82.30,
|
||||||
|
sem,semi1276,семит.,Semitic,Sem.,Afro-Asiatic,Semitic,coordinates of Imperial Aramaic,33.91,42.19,
|
||||||
|
sga,oldi1246,др.ирл.,Old Irish,OIrish,Indo-European,Celtic,,53.22,-7.62,
|
||||||
|
sgh,shug1248,пам. ш.,Shughni,Shugh.,Indo-European,Iranian,,37.5018,71.7925,
|
||||||
|
sgh-x-bartang,bart1238,пам. барт.,Bartangi,Bart.,Indo-European,Iranian,,38.21974,72.11835,
|
||||||
|
sgh-x-khufi,khuf1238,хуф.,Khufi,Khufi,Indo-European,Iranian,,37.8595,71.60373,
|
||||||
|
sgh-x-oroshori,oros1238,пам. ор.,Roshorvi,Rosh.,Indo-European,Iranian,,38.38796,72.7418,
|
||||||
|
sgr,sang1315,сангисарское,Sangsari,Sangsari,Indo-European,Iranian,,35.72,53.3,
|
||||||
|
sgy,sang1344,пам. сгл.,Sanglechi,Sangl.,Indo-European,Iranian,,36.45,71.3,
|
||||||
|
sgy-x-zebak,zeba1237,пам. зеб.,Zebaki,Zeb.,Indo-European,Iranian,may actually be a variety of Ishkashimi; coordinates of Zebak district,36.5469,71.3423,
|
||||||
|
sh,sout1528,сербо-хорв.,Serbo-Croatian,SCr.,Indo-European,Slavic,,44.15,18.81,
|
||||||
|
si,sinh1246,синг.,Sinhalese,Sinh.,Indo-European,Indic,,8.00,81.00,
|
||||||
|
sk,slov1269,словац.,Slovak,Slovak,Indo-European,Slavic,,48.55,18.78,
|
||||||
|
sl,slov1268,слов.,Slovenian,Slovene,Indo-European,Slavic,,46.2543,14.7766,
|
||||||
|
sla,slav1255,слав.,Slavic,Sl.,Indo-European,Slavic,coordinates of Rusyn (roughly at the centre of historical Slavic territory),48.72,22.96,
|
||||||
|
smi,saam1281,лопар.,Saami,Sami,Uralic,Saami,coordinates of Kemi Saami,67.09,27.54,
|
||||||
|
smi-x-sm,saam1281,саам.,Saami,Sami,Uralic,Saami,coordinates of Kemi Saami,67.09,27.54, Abaev used «лопар.» in the earlier volumes so these are viewed as distinct
|
||||||
|
smy,semn1251,семнан.,Semnani,Semn.,Indo-European,Iranian,,35.53,53.29,
|
||||||
|
sog,sogd1245,согд.,Sogdian,Sogd.,Indo-European,Iranian,,39.7,66.983,
|
||||||
|
sog-x-budd,sogd1245,согд. будд.,Buddhist Sogdian,Sogd. Bud.,Indo-European,Iranian,,39.7,66.983,
|
||||||
|
sog-x-chr,sogd1245,согд. христ.,Christian Sogdian,Sogd. Chr.,Indo-European,Iranian,,39.7,66.983,
|
||||||
|
sog-x-man,sogd1245,согд. ман.,Manichaean Sogdian,Sogd. Man.,Indo-European,Iranian,,39.7,66.983,
|
||||||
|
sog-x-mugh,sogd1245,согд. (Муг),Sogdian (Mugh),Sogd. (Mugh),Indo-European,Iranian,,39.7,66.983,
|
||||||
|
sqj,alba1267,алб.,Albanian,Alb.,Indo-European,Albanian,coordinates of Northern Tosk,41.00,20.00,
|
||||||
|
sr,serb1264,серб.,Serbian,Serb.,Indo-European,Slavic,,44.3238,21.9192,
|
||||||
|
srh,sari1246,пам. с.,Sarikoli,Sarik.,Indo-European,Iranian,,37.905,75.1449,
|
||||||
|
sty,tobo1250,тобол.,Tobol Tatar,Tobol,Altaic,Turkic,,58.1896,68.2581,
|
||||||
|
sty-x-brb,bara1273,барабин.,Baraba Tatar,Baraba,Altaic,Turkic,,55.05,82.95,coordinates of Novosibirsk
|
||||||
|
sux,sume1241,шумер.,Sumerian,Sum.,Sumerian,Sumerian,,31.3,45.6667,
|
||||||
|
sv,swed1254,швед.,Swedish,Swed.,Indo-European,Germanic,,59.800634,17.389526,
|
||||||
|
sv-x-dial,swed1254,швед. (диал.),Swedish (dialectal),Swed. (dial.),Indo-European,Germanic,,59.800634,17.389526,
|
||||||
|
sva,svan1243,сван.,Svan,Sv.,Kartvelian,Kartvelian,,42.9134,42.5915,
|
||||||
|
syd,samo1298,самодийское,Samoyedic,Sam.,Uralic,Samoyedic,coordinates of Forest Enets,68.60,86.50,
|
||||||
|
syd-x-south,samo1298,южносамодийское,South Samoyedic,SSam.,Uralic,Samoyedic,coordinates of Selkup,59.94,82.30,
|
||||||
|
syr,clas1252,сир.,Syriac,Syr.,Afro-Asiatic,Semitic,,37.1129,42.1432,
|
||||||
|
ta,tami1289,тамил.,Tamil,Tam.,Dravidian,Dravidian,,10.52,78.83,
|
||||||
|
tab,taba1259,табас.,Tabassaran,Tabas.,NE Caucasian,Lezgic,,42.0198,47.8379,
|
||||||
|
tg,taji1245,тадж.,Tajik,Taj.,Indo-European,Iranian,,38.8213,68.5549,
|
||||||
|
tg-x-dial,taji1245,тадж. (диал.),Tajik (dialectal),Taj. (dial.),Indo-European,Iranian,,38.8213,68.5549,
|
||||||
|
tg-x-qrtg,kara1511,тадж. (каратег.),Tajik (Qarategin),Taj. (Qarateg.),Indo-European,Iranian,coordinates of Rasht Valley,39.0863,70.7011,
|
||||||
|
tg-x-se,taji1245,тадж. (юго-восточные говоры),Tajik (South-Eastern varieties),Taj. (SE),Indo-European,Iranian,coordinates of Darwazi,38.32,70.76,
|
||||||
|
tg-x-vanj,taji1245,тадж. (вандж.),Tajik (Vanj),Taj. (Vanj),Indo-European,Iranian,add coordinates,38.8213,68.5549,
|
||||||
|
tin,tind1238,тинд.,Tindi,Tindi,NE Caucasian,Avar-Andic-Tsezic,,42.33,45.92,
|
||||||
|
tk,turk1304,туркм.,Turkmen,Turkm.,Altaic,Turkic,,37.08719,59.17574,
|
||||||
|
tkr,tsak1249,цахур.,Tsakhur,Tsakh.,NE Caucasian,Lezgic,,41.5916,46.8858,
|
||||||
|
tly,taly1247,тал.,Talyshi,Tal.,Indo-European,Iranian,,38.4552,48.6349,
|
||||||
|
tr,nucl1301,тур.,Turkish,Tr.,Altaic,Turkic,,39.8667,32.8667,
|
||||||
|
tr-x-anat,anat1259,анат.,Anatolian Turkish,Anat.,Altaic,Turkic,,39.87,32.87,
|
||||||
|
tr-x-dial,nucl1301,тур. (диал.),Turkish (dialectal),Tr. (dial.),Altaic,Turkic,,39.8667,32.8667,
|
||||||
|
trk,turk1311,тюрк.,Turkic,Turk.,Altaic,Turkic,,-99,-99,
|
||||||
|
trk-x-east,turk1311,восточнотюрк.,East Turkic,ETurk.,Altaic,Turkic,I assume this is SE Turkic,40.89,69.21, coord of Uzbek
|
||||||
|
trk-x-mid,turk1311,среднетюрк.,Middle Turkic,MTurk.,Altaic,Turkic,,-99,-99,
|
||||||
|
trk-x-north,turk1311,сев. тюрк.,North Turkic,NTurk.,Altaic,Turkic,"Unclear: Kipchak or Siberian? Coordinates of Bashkir, on the assumption that this refers to Kipchak",53.60,56.56,
|
||||||
|
tt,tata1255,татар.,Tatar,Tat.,Altaic,Turkic,,55.79592,49.11577,
|
||||||
|
tt-x-dial,tata1255,татар. (диал.),Tatar (dialectal),Tat. (dial.),Altaic,Turkic,,55.79592,49.11577,
|
||||||
|
tt-x-kazan,kaza1250,казан.,Kazan Tatar,Kazan,Altaic,Turkic,,55.796389,49.108889,
|
||||||
|
ttt,cauc1242,татск.,Tat,Tat,Indo-European,Iranian,coordinates of Muslim Tat,41.43,46.65,
|
||||||
|
txb,tokh1243,тохар. B,Tocharian B,Toch. B,Indo-European,Tocharian,,41.65,82.9,
|
||||||
|
txh,thra1250,фрак.,Thracian,Thrac.,Indo-European,Thracian,,42.115469,24.711977,
|
||||||
|
uby,ubyk1235,убых.,Ubykh,Ub.,NW Caucasian,NW Caucasian,,43.67,39.67,
|
||||||
|
udi,udii1243,удин.,Udi,Udi,NE Caucasian,Lezgic,,40.9,47.7236,
|
||||||
|
udm,udmu1245,удм.,Udmurt,Udm.,Uralic,Permic,,56.12921,52.63548,
|
||||||
|
ug,uigh1240,уйгур.,Uyghur,Uygh.,Altaic,Turkic,,43.88,87.38,
|
||||||
|
ug-x-kashgar,kash1278,кашг.,Kashgari Uyghur,Kashg.,Altaic,Turkic,,39.4681,75.9938,
|
||||||
|
uk,ukra1253,укр.,Ukrainian,Ukr.,Indo-European,Slavic,,49.796,29.945,
|
||||||
|
uk-x-gal,ukra1253,укр. (галиц.),Ukrainian (Galician),Ukr. (Gal.),Indo-European,Slavic,,49.796,29.945,
|
||||||
|
uk-x-west,ukra1253,укр. (зап.),Ukrainian (western),Ukr. (w.),Indo-European,Slavic,,49.796,29.945,
|
||||||
|
ur,urdu1245,урду,Urdu,Urdu,Indo-European,Indic,,25.00,67.00,
|
||||||
|
uz,uzbe1247,узб.,Uzbek,Uz.,Altaic,Turkic,coordinates of Northern Uzbek (in Uzbekistan),40.89,69.21,
|
||||||
|
vep,veps1250,вепс.,Veps,Veps,Uralic,Finnic,,60.3353,34.7865,
|
||||||
|
wbl,wakh1245,пам. в.,Wakhi,Wakhi,Indo-European,Iranian,,37.1768,73.9777,
|
||||||
|
wen,sorb1249,луж.,Sorbian,Sorb.,Indo-European,Slavic,coordinates of Upper Sorbian,51.24,14.41,
|
||||||
|
wep,west2356,нем. (вестф.),Westphalic,Westph.,Indo-European,Germanic,,51.46,7.50,
|
||||||
|
wne,wane1241,ванеци,Wanetsi,Wan.,Indo-European,Iranian,,30.0501,67.8327,
|
||||||
|
wsv,wota1240,вотапурско-катаркалайское,Wotapuri-Katarqalai,Wot.-Kat.,Indo-European,Indic,,34.958246,71.090876,
|
||||||
|
x-balochi,balo1260,бел.,Balochi,Bal.,Indo-European,Iranian,coordinates of Eastern Balochi,28.00,62.00,
|
||||||
|
x-barakai,0,варакаи,Barakai,Barakai,Indo-European,Iranian,"cited in Tomaschek, but I cannot find any trace of this dialect in the sources. Probably not Pamir but W. Iranian",-99,-99,
|
||||||
|
x-dardic,dard1244,дард.,Dardic,Dard.,Indo-European,Indic,,34.96,72.93,
|
||||||
|
x-mordvin,mord1256,морд.,Mordvinic,Mord.,Uralic,Mordvin,coordinates of Saransk,54.177,45.1833,
|
||||||
|
x-nuristan,nuri1243,кафир.,Nuristani,Nur.,Indo-European,Nuristani,coordinates of Kalasha,35.19,70.99,
|
||||||
|
x-oldirn,iran1269,др.иран.,Old Iranian,OIr.,Indo-European,Iranian,,-99,-99,
|
||||||
|
x-oldsl,slav1255,др.слав.,Old Slavic,OSl.,Indo-European,Slavic,,-99,-99,
|
||||||
|
x-pamir,0,пам.,Pamir,Pam.,Indo-European,Iranian,coordinates of Gorno-Badakhshan,38,73,
|
||||||
|
x-pamir-n,0,пам. н.??,Pamir,Pam.,Indo-European,Iranian,,38,73,
|
||||||
|
x-rushani,rush1239,пам. руш.,Rushani,Rush.,Indo-European,Iranian,,38.07829,71.58549,
|
||||||
|
x-sarm,0,сарм.,Sarmatian,Sarm.,Indo-European,Iranian,coordinates of Volgograd (arbitrary),48.707085,44.517016,
|
||||||
|
x-tchr,tokh1241,тохар.,Tocharian,Toch.,Indo-European,Tocharian,coordinates of Tocharian B,41.65,82.90,
|
||||||
|
x-vaynakh,chec1244,вейнах.,Vaynakh,Vayn.,NE Caucasian,Nakh,coordinates of Achkhoi-Martan,43.1813,45.2846,
|
||||||
|
xal,kalm1243,калм.,Kalmyk,Kalm.,Altaic,Turkic,,46.566667,45.316667,
|
||||||
|
xbc,bact1239,кушан.,Bactrian,Bact.,Indo-European,Iranian,,36.81,66.85,
|
||||||
|
xbo,bolg1250,булг.,Bulgar,Bulgar,Altaic,Turkic,,48.671481,42.729234,
|
||||||
|
xcl,clas1249,арм.,Armenian,Arm.,Indo-European,Armenian,,38.592316,41.346422,
|
||||||
|
xco,khwa1238,хорезм.,Khwarezmian,Khwar.,Indo-European,Iranian,,41.68,60.75,
|
||||||
|
xco-x-late,khwa1238,позднехорезм.,Late Khwarezmian,LKhwar.,Indo-European,Iranian,,,,
|
||||||
|
xhu,hurr1240,хурр.,Hurrian,Hurr.,Hurro-Urartian,Hurro-Urartian,,40.7339,43.3154,
|
||||||
|
xld,lydi1241,лид.,Lydian,Lyd.,Indo-European,Anatolian,,40,30,
|
||||||
|
xln,0,алан.,Alanic,Alan.,Indo-European,Iranian,coordinates of Arkhyz,43.5603,41.2798,
|
||||||
|
xlu,luvi1235,лув.,Luwian,Luw.,Indo-European,Anatolian,cuneiform,38.00,36.00,
|
||||||
|
xme,0,мид.,Median,Med.,Indo-European,Iranian,,37,47,
|
||||||
|
xmf,ming1252,мегр.,Mingerlian,Ming.,Kartvelian,Kartvelian,,42.5129,41.8719,
|
||||||
|
xmn,pahl1241,пехл. (маних.),Manichaean Middle Persian,MPers. (Man.),Indo-European,Iranian,,30.06,52.7,
|
||||||
|
xpg,phry1239,фриг.,Phrygian,Phr.,Indo-European,Phrygian,,39.613,31.28,
|
||||||
|
xpr,part1239,парф.,Parthian,Parth.,Indo-European,Iranian,,37.052,56.056,
|
||||||
|
xsc,0,скиф.,Scythian,Scyth.,Indo-European,Iranian,coordinates of Lugansk,48.5763,39.3335,
|
||||||
|
xtg,tran1282,галл.,Gaulish,Gaul.,Indo-European,Celtic,or Cisalpine? Glottolog Transalpine,43.97,3.3,
|
||||||
|
xto,tokh1242,тохар. A,Tocharian A,Toch. A,Indo-European,Tocharian,,42.98,89.18,
|
||||||
|
xtq,tums1237,сак. (Тумшук),Tumshuqese,Tumsh.,Indo-European,Iranian,,39.866667,79.066667,
|
||||||
|
xum,umbr1253,умбр.,Umbrian,Umbr.,Indo-European,Italic,,42.75,13.02,
|
||||||
|
yah,yazg1240,пам. язг.,Yazgulyami,Yazg.,Indo-European,Iranian,,38.2801,71.565,
|
||||||
|
yai,yagn1238,ягн.,Yaghnobi,Yaghn.,Indo-European,Iranian,,39.1486,69.2422,
|
||||||
|
ydg,yidg1240,пам. и.,Yidgha,Yid.,Indo-European,Iranian,,36.014,71.5077,
|
||||||
|
yrk,nene1251,нен.,Nenets,Nen.,Uralic,Samoyedic,coordinates of Tundra Nenets,66.18,71.02,
|
||||||
|
ysc,oldo1234,ясск.,Jassic,Jas.,Indo-European,Iranian,,48.48,39.46,
|
||||||
|
zh,sini1245,кит.,Chinese,Chin.,Sino-Tibetan,Chinese,,34.09,109.05,
|
||||||
|
zkz,0,хазарск.,Khazar,Khaz.,Altaic,Turkic,coordinates of Samosdelka (Itil site),46.024,47.83975,
|
||||||
|
zza,zaza1246,заза,Zazaki,Zaz.,Indo-European,Iranian,coordinates of Dimli,38.61,39.64,
|
|
30
scripts/update-indices.bxs
Normal file
30
scripts/update-indices.bxs
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Generate the lookup entries and the English and Russian
|
||||||
|
# standardized TEI
|
||||||
|
OPEN abaevdict
|
||||||
|
OPTIMIZE ALL
|
||||||
|
# the directory in parse-langnames
|
||||||
|
# may be incorrectly determined, check
|
||||||
|
RUN ../xq/parse-langnames.xq
|
||||||
|
RUN ../xq/make-lookup.xq
|
||||||
|
RUN ../xq/gen-lng-entries.xq
|
||||||
|
CLOSE
|
||||||
|
|
||||||
|
# Generate the HTML for faster page generation
|
||||||
|
RUN ../xq/gen-lng-html.xq
|
||||||
|
|
||||||
|
# Optimize the generated databases
|
||||||
|
OPEN abaevdict_en
|
||||||
|
OPTIMIZE ALL
|
||||||
|
CLOSE
|
||||||
|
|
||||||
|
OPEN abaevdict_ru
|
||||||
|
OPTIMIZE ALL
|
||||||
|
CLOSE
|
||||||
|
|
||||||
|
# Create mentioned indices
|
||||||
|
RUN ../xq/gen-mentioned-index.xq
|
||||||
|
|
||||||
|
# Optimize the index database
|
||||||
|
OPEN abaevdict_index
|
||||||
|
OPTIMIZE ALL
|
||||||
|
CLOSE
|
411
static/abaev-html.css
Normal file
411
static/abaev-html.css
Normal file
|
@ -0,0 +1,411 @@
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Universal
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
/* Apply styling to all elements (including their `::before` and `::after`
|
||||||
|
pseudo-elements). One common use of this selector is to apply a custom
|
||||||
|
`box-sizing`. */
|
||||||
|
*, *::before, *::after {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Root
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
:root {}
|
||||||
|
html {}
|
||||||
|
body {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Content sectioning
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6 {}
|
||||||
|
h1 {}
|
||||||
|
h2 {}
|
||||||
|
h3 {}
|
||||||
|
h4 {}
|
||||||
|
h5 {}
|
||||||
|
h6 {}
|
||||||
|
|
||||||
|
body > header {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
background: white;
|
||||||
|
border-bottom-width: thin;
|
||||||
|
border-bottom-style: solid;
|
||||||
|
padding-bottom: 0px !important;
|
||||||
|
padding-top: 0px !important;
|
||||||
|
padding-right: 1em !important;
|
||||||
|
padding-left: 1em !important;
|
||||||
|
/* color: #f1f1f1; */
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {}
|
||||||
|
nav ul, nav ol {}
|
||||||
|
nav li {}
|
||||||
|
nav a {}
|
||||||
|
nav a:visited {}
|
||||||
|
nav a:hover {}
|
||||||
|
nav a:active {}
|
||||||
|
|
||||||
|
nav#entrylist {
|
||||||
|
height: 90%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: scroll;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {}
|
||||||
|
|
||||||
|
article.abv-entry {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0px,15%) 5% minmax(50%,80%);
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
section {}
|
||||||
|
|
||||||
|
aside#leftbar {
|
||||||
|
/* The side navigation menu */
|
||||||
|
height: 100%; /* 100% Full-height */
|
||||||
|
width: 250px; /* 0 width - change this with JavaScript */
|
||||||
|
display: none;
|
||||||
|
position: fixed; /* Stay in place */
|
||||||
|
z-index: 1; /* Stay on top */
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
overflow-x: hidden; /* Disable horizontal scroll */
|
||||||
|
overflow-y: hidden;
|
||||||
|
padding-top: 0px; /* Place content 60px from the top */
|
||||||
|
background-color: #dcdcdc;
|
||||||
|
transition: 0.5s; /* 0.5 second transition effect to slide in the sidenav */
|
||||||
|
}
|
||||||
|
|
||||||
|
search {}
|
||||||
|
|
||||||
|
body > footer {
|
||||||
|
position: sticky;
|
||||||
|
bottom: 0;
|
||||||
|
background: white;
|
||||||
|
border-top-width: thin;
|
||||||
|
border-top-style: solid;
|
||||||
|
padding-top: 0px !important;
|
||||||
|
padding-bottom: 0px !important;
|
||||||
|
/* color: #f1f1f1; */
|
||||||
|
}
|
||||||
|
|
||||||
|
address {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Text block content
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
/* Overall styling, e.g. vertical spacing */
|
||||||
|
p, ol, ul, pre, blockquote, figure, hr, dl {}
|
||||||
|
|
||||||
|
p {}
|
||||||
|
|
||||||
|
ol, ul {}
|
||||||
|
ol {}
|
||||||
|
ul {}
|
||||||
|
li {}
|
||||||
|
ol ol, ol ul, ul ul, ul ol {}
|
||||||
|
li li {}
|
||||||
|
|
||||||
|
pre {}
|
||||||
|
pre code {}
|
||||||
|
pre samp {}
|
||||||
|
|
||||||
|
blockquote {}
|
||||||
|
|
||||||
|
figure {}
|
||||||
|
figcaption {}
|
||||||
|
|
||||||
|
hr {}
|
||||||
|
|
||||||
|
dl {}
|
||||||
|
dt {}
|
||||||
|
dd {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Inline text semantics
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
a {}
|
||||||
|
a:visited {}
|
||||||
|
a:hover {}
|
||||||
|
a:active {}
|
||||||
|
|
||||||
|
strong {}
|
||||||
|
b {}
|
||||||
|
|
||||||
|
em {}
|
||||||
|
i {}
|
||||||
|
|
||||||
|
q {
|
||||||
|
quotes: "‘" "’";
|
||||||
|
}
|
||||||
|
cite {}
|
||||||
|
|
||||||
|
s {}
|
||||||
|
|
||||||
|
mark {}
|
||||||
|
|
||||||
|
/* If you specify a font size, consider using the `em` unit so that it works
|
||||||
|
universally, e.g. for both `h1 small` and `p small` */
|
||||||
|
small {}
|
||||||
|
sub {}
|
||||||
|
sup {}
|
||||||
|
|
||||||
|
code {}
|
||||||
|
|
||||||
|
dfn {}
|
||||||
|
abbr {}
|
||||||
|
abbr[title] {}
|
||||||
|
|
||||||
|
var {}
|
||||||
|
kbd {}
|
||||||
|
kbd kbd {}
|
||||||
|
samp {}
|
||||||
|
|
||||||
|
u {}
|
||||||
|
|
||||||
|
data {}
|
||||||
|
time {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Demarcating edits
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
del {}
|
||||||
|
ins {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Embedded content
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
img {}
|
||||||
|
svg {}
|
||||||
|
video {}
|
||||||
|
canvas {}
|
||||||
|
audio {}
|
||||||
|
object {}
|
||||||
|
|
||||||
|
noscript {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Table content
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
table {}
|
||||||
|
caption {}
|
||||||
|
col:first-child {}
|
||||||
|
thead {}
|
||||||
|
tbody {}
|
||||||
|
tfoot {}
|
||||||
|
tr {}
|
||||||
|
th {}
|
||||||
|
td {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Forms
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
fieldset {}
|
||||||
|
fieldset:disabled {}
|
||||||
|
legend {}
|
||||||
|
|
||||||
|
form {}
|
||||||
|
|
||||||
|
label {}
|
||||||
|
|
||||||
|
::placeholder {}
|
||||||
|
:focus::placeholder {}
|
||||||
|
|
||||||
|
/* Overall styling, e.g. vertical spacing */
|
||||||
|
input, textarea, select, button {}
|
||||||
|
|
||||||
|
/* `textarea` and `input` elements that share a similar look and similar styling
|
||||||
|
capabilities */
|
||||||
|
/* - common styling */
|
||||||
|
textarea,
|
||||||
|
input[type="text"],
|
||||||
|
input[type="password"],
|
||||||
|
input[type="email"],
|
||||||
|
input[type="tel"],
|
||||||
|
input[type="number"],
|
||||||
|
input[type="search"],
|
||||||
|
input[type="url"],
|
||||||
|
input[type="date"],
|
||||||
|
input[type="datetime-local"],
|
||||||
|
input[type="month"],
|
||||||
|
input[type="week"],
|
||||||
|
input[type="time"] {}
|
||||||
|
/* - individual styling */
|
||||||
|
textarea {}
|
||||||
|
input[type="text"] {}
|
||||||
|
input[type="password"] {}
|
||||||
|
input[type="email"] {}
|
||||||
|
input[type="tel"] {}
|
||||||
|
input[type="number"] {}
|
||||||
|
input[type="search"] {}
|
||||||
|
input[type="url"] {}
|
||||||
|
input[type="date"] {}
|
||||||
|
input[type="datetime-local"] {}
|
||||||
|
input[type="month"] {}
|
||||||
|
input[type="week"] {}
|
||||||
|
input[type="time"] {}
|
||||||
|
/* Tick boxes */
|
||||||
|
input[type="checkbox"], input[type="radio"] {}
|
||||||
|
input[type="checkbox"]:checked, input[type="radio"]:checked {}
|
||||||
|
input[type="checkbox"] {}
|
||||||
|
input[type="checkbox"]:checked {}
|
||||||
|
input[type="radio"] {}
|
||||||
|
input[type="radio"]:checked {}
|
||||||
|
/* Other input fields, some with limited styling capabilities */
|
||||||
|
input[type="file"] {}
|
||||||
|
input[type="color"] {}
|
||||||
|
input[type="range"] {}
|
||||||
|
|
||||||
|
select {}
|
||||||
|
|
||||||
|
div.index {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 20% 20% 60%;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div {
|
||||||
|
height: 85vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div select {
|
||||||
|
height: 90%;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
optgroup {}
|
||||||
|
option {}
|
||||||
|
option:checked {}
|
||||||
|
datalist {}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input[type="submit"] {}
|
||||||
|
button:disabled,
|
||||||
|
input[type="submit"]:disabled {}
|
||||||
|
button.secondary {}
|
||||||
|
button.secondary:disabled {}
|
||||||
|
|
||||||
|
button#open-leftbar{
|
||||||
|
position: fixed;
|
||||||
|
top: 50vh;
|
||||||
|
left: 0;
|
||||||
|
/*height: 1ex;*/
|
||||||
|
/*line-height: 1ex;*/
|
||||||
|
/*width: 1em;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
button#close-leftbar{
|
||||||
|
position: fixed;
|
||||||
|
top: 50vh;
|
||||||
|
left: 250px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This matches forms or form elements that are invalid *and* have been
|
||||||
|
interacted with. Note that:
|
||||||
|
1) You may need to add the `interacted` class to forms yourself
|
||||||
|
2) You may need to add the `touched` class to form fields yourself
|
||||||
|
3) `:user-invalid` is a working draft and not yet supported by most browsers
|
||||||
|
4) `:-moz-ui-invalid` is non-standard and only works in Firefox
|
||||||
|
Form validation error messages will appear (in capable browsers) regardless of
|
||||||
|
this styling. You can omit 1) and 2) and still have working forms. Perfect
|
||||||
|
example of progressive enhancement. */
|
||||||
|
/* Applies to invalid forms */
|
||||||
|
form.interacted:invalid {}
|
||||||
|
/* Applies to invalid form fields. You would need to repeat your declarations
|
||||||
|
for the following three groups of selectors individually. Browsers completely
|
||||||
|
ignore any rule that contains a selector they do not know. */
|
||||||
|
form.interacted :invalid, form .touched:invalid {}
|
||||||
|
:user-invalid {}
|
||||||
|
:-moz-ui-invalid {}
|
||||||
|
|
||||||
|
output {}
|
||||||
|
|
||||||
|
progress {}
|
||||||
|
meter {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Interactive elements
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
details {}
|
||||||
|
details[open] {}
|
||||||
|
summary {}
|
||||||
|
details[open] summary {}
|
||||||
|
|
||||||
|
dialog {}
|
||||||
|
dialog::backdrop {}
|
||||||
|
|
||||||
|
dialog#modal_map > article {
|
||||||
|
width: 75vw !important;
|
||||||
|
height: 85vh !important;
|
||||||
|
max-width: 75vw !important;
|
||||||
|
max-height: 85vh !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Some form fields, `details`, elements with `tabindex`, and possibly other
|
||||||
|
elements can be focussed. You should use `:focus-visible` instead of `:focus`
|
||||||
|
whenever possible. As the former is not yet widely supported, you need to do it
|
||||||
|
as follows:
|
||||||
|
1) Set styling on focus
|
||||||
|
2) If browser supports `:focus-visible`, revert/unset the styling from 1)
|
||||||
|
3) If the element matches `:focus-visible`, apply the styling again */
|
||||||
|
:focus {}
|
||||||
|
:focus:not(:focus-visible) {}
|
||||||
|
:focus-visible {}
|
||||||
|
|
||||||
|
[inert], [inert] * {}
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Media queries
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (orientation: portrait) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (orientation: landscape) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
}
|
||||||
|
|
||||||
|
/* CUSTOM: SPANS */
|
||||||
|
span.abv-text-ul {
|
||||||
|
text-decoration-line: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.abv-text-sc {
|
||||||
|
font-variant-caps: small-caps;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
This file evolved from Natural Selection:
|
||||||
|
https://github.com/frontaid/natural-selection
|
||||||
|
*/
|
61
static/abaev-index.js
Normal file
61
static/abaev-index.js
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
$( document ).ready(function() {
|
||||||
|
$('#abv-select-lang').on('input', function() {
|
||||||
|
let $selected = $(this).children('option:selected');
|
||||||
|
let url = `../api/languages/${$selected.attr('value')}`;
|
||||||
|
|
||||||
|
fetch(url)
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(out => {
|
||||||
|
let $select_word = $('#abv-select-word');
|
||||||
|
let $select_entry = $('#abv-select-entry');
|
||||||
|
$select_word.empty();
|
||||||
|
$select_entry.empty();
|
||||||
|
for (w of out.words) {
|
||||||
|
$select_word.append(new Option(w.text,w.id))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#abv-select-word').on('input', function() {
|
||||||
|
let $selected = $(this).children('option:selected');
|
||||||
|
let wordid = $selected.attr('value');
|
||||||
|
let lang = $('#abv-select-lang').children('option:selected').attr('value');
|
||||||
|
let url = `../api/languages/${lang}/words/${wordid}`;
|
||||||
|
|
||||||
|
fetch(url)
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(out => {
|
||||||
|
let $select_entry = $('#abv-select-entry');
|
||||||
|
$select_entry.empty();
|
||||||
|
for (e of out.entries) {
|
||||||
|
url_entry = `../api/entries/${e.id}`;
|
||||||
|
fetch(url_entry)
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(out => {
|
||||||
|
let entrystring = out.form;
|
||||||
|
let glosses = [];
|
||||||
|
for (r of e.refs) {
|
||||||
|
if (r.glosses) {
|
||||||
|
for(g of r.glosses){
|
||||||
|
glosses.push(g);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(glosses.length > 0) {
|
||||||
|
entrystring += ` (${glosses.join('; ')})`
|
||||||
|
}
|
||||||
|
$select_entry.append(new Option(entrystring,out.xmlid))
|
||||||
|
})
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#abv-select-entry').on("dblclick", function() {
|
||||||
|
let $selected = $(this).children('option:selected');
|
||||||
|
let $entry = $selected.attr('value');
|
||||||
|
window.location.replace('../dict/' + $entry);
|
||||||
|
});
|
||||||
|
});
|
171
static/abaev.js
Normal file
171
static/abaev.js
Normal file
|
@ -0,0 +1,171 @@
|
||||||
|
$( document ).ready(function() {
|
||||||
|
function bindMapOpen() {
|
||||||
|
// $('#modal_map').data('abv-entry',$(this).data('abv-entry'));
|
||||||
|
// $('#modal_map')[0].showModal();
|
||||||
|
let url = `../dict/map-info/${$(this).data('abv-entry')}`;
|
||||||
|
|
||||||
|
fetch(url)
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(out => {
|
||||||
|
$('#modal_map').data('map',out);
|
||||||
|
$('#modal_map')[0].showModal();
|
||||||
|
})
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event to open map modal. We have to bind it
|
||||||
|
// when the button is shown, otherwise it will
|
||||||
|
// not work for newly loaded entries.
|
||||||
|
$('.abv-map').on("click", bindMapOpen);
|
||||||
|
|
||||||
|
// init Infinite Scroll
|
||||||
|
$('main').infiniteScroll({
|
||||||
|
path: '.pagination__next',
|
||||||
|
append: '.abv-entry',
|
||||||
|
//status: '.scroller-status',
|
||||||
|
//hideNav: '.pagination',
|
||||||
|
});
|
||||||
|
|
||||||
|
$('main').on( 'append.infiniteScroll', function( event, body, path, response ) {
|
||||||
|
$('.abv-map').on("click", bindMapOpen);
|
||||||
|
});
|
||||||
|
|
||||||
|
// If the hash is on the page, scroll a little bit above to account for top nav height
|
||||||
|
if ( $(decodeURI(document.location.hash)).length > 0) {
|
||||||
|
window.scrollBy(0,-$('header').height());
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the hash is not on the page, go to the right page by using the ID interface
|
||||||
|
$( window ).on('hashchange', function() {
|
||||||
|
const hash = decodeURI(document.location.hash);
|
||||||
|
|
||||||
|
if ( hash.startsWith('#entry_') ) {
|
||||||
|
if ( $(hash).length == 0) {
|
||||||
|
window.location.replace(document.location.pathname + '/' + document.location.hash.substring(1));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.scrollBy(0,-$('header').height());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Function to scroll the entry list to the selected entry OR to the first entry displayed on the current page if there is no hash in the URL
|
||||||
|
function scrollView() {
|
||||||
|
var $container = $('#entrylist')
|
||||||
|
if (document.location.hash.length > 0) {
|
||||||
|
var $scrollTo = $(`#link_${$(decodeURI(document.location.hash)).attr('id')}`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var $scrollTo = $(`#link_${$('article:first').attr('id')}`);
|
||||||
|
}
|
||||||
|
$container.scrollTop(
|
||||||
|
$scrollTo.offset().top - $container.offset().top + $container.scrollTop())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Click to open the offcanvas entry list
|
||||||
|
$( '#open-leftbar' ).on('click', function() {
|
||||||
|
// $("#leftbar")[0].style.width = "250px";
|
||||||
|
$("#leftbar").show();
|
||||||
|
// $("#leftbar")[0].style.paddingLeft = "10px";
|
||||||
|
|
||||||
|
$("main")[0].style.marginLeft = "250px";
|
||||||
|
$("header")[0].style.marginLeft = "250px";
|
||||||
|
$("footer")[0].style.marginLeft = "250px";
|
||||||
|
$("#open-leftbar").hide();
|
||||||
|
$("#close-leftbar").show();
|
||||||
|
|
||||||
|
scrollView();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Click to close the offcanvas entry list
|
||||||
|
$( '#close-leftbar' ).on('click', function() {
|
||||||
|
$("#leftbar").hide();
|
||||||
|
// $("#leftbar")[0].style.paddingLeft = null;
|
||||||
|
$("main")[0].style.marginLeft = null;
|
||||||
|
$("header")[0].style.marginLeft = null;
|
||||||
|
$("footer")[0].style.marginLeft = null;
|
||||||
|
$("#open-leftbar").show();
|
||||||
|
$("#close-leftbar").hide();
|
||||||
|
})
|
||||||
|
|
||||||
|
// Quick filter functionality
|
||||||
|
$('#filter-entries').on("keyup", function () {
|
||||||
|
var value = $(this).val().toLowerCase();
|
||||||
|
if (value.length > 1) {
|
||||||
|
$("#entrylist > ul > li").filter(function () {
|
||||||
|
return $(this).toggle($(this).children('a').text().toLowerCase().indexOf(value) > -1)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close map modal
|
||||||
|
$('.abv-close-map').on("click", function () {
|
||||||
|
$('#modal_map')[0].close();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Load map data when dialog opens
|
||||||
|
$('#modal_map').on("toggle", function () {
|
||||||
|
map = document.getElementById('map_display');
|
||||||
|
var layout = {
|
||||||
|
// title: {
|
||||||
|
// text: 'Canadian cities',
|
||||||
|
// font: {
|
||||||
|
// family: 'Droid Serif, serif',
|
||||||
|
// size: 16
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
geo: {
|
||||||
|
scope: 'world',
|
||||||
|
resolution: 50,
|
||||||
|
fitbounds: 'locations',
|
||||||
|
showrivers: true,
|
||||||
|
rivercolor: '#fff',
|
||||||
|
showlakes: true,
|
||||||
|
lakecolor: '#fff',
|
||||||
|
showland: true,
|
||||||
|
landcolor: '#EAEAAE',
|
||||||
|
showcountries: false,
|
||||||
|
subunitcolor: '#d3d3d3'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Plotly.newPlot(map, [$(this).data('map')], layout);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// var data = [{
|
||||||
|
// type: 'scattergeo',
|
||||||
|
// mode: 'markers+text',
|
||||||
|
// text: [
|
||||||
|
// 'Montreal', 'Toronto', 'Vancouver', 'Calgary', 'Edmonton',
|
||||||
|
// 'Ottawa', 'Halifax', 'Victoria', 'Winnepeg', 'Regina'
|
||||||
|
// ],
|
||||||
|
// hovertext: 'HIMEM.SYS<br>EGAVGA.BGI',
|
||||||
|
// hoverinfo: 'text',
|
||||||
|
// lon: [
|
||||||
|
// -73.57, -79.24, -123.06, -114.1, -113.28,
|
||||||
|
// -75.43, -63.57, -123.21, -97.13, -104.6
|
||||||
|
// ],
|
||||||
|
// lat: [
|
||||||
|
// 45.5, 43.4, 49.13, 51.1, 53.34, 45.24,
|
||||||
|
// 44.64, 48.25, 49.89, 50.45
|
||||||
|
// ],
|
||||||
|
// marker: {
|
||||||
|
// size: 7,
|
||||||
|
// // color: [
|
||||||
|
// // '#bebada', '#fdb462', '#fb8072', '#d9d9d9', '#bc80bd',
|
||||||
|
// // '#b3de69', '#8dd3c7', '#80b1d3', '#fccde5', '#ffffb3'
|
||||||
|
// // ],
|
||||||
|
// line: {
|
||||||
|
// width: 1
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// name: 'Canadian cities',
|
||||||
|
// textposition: [
|
||||||
|
// 'top right', 'top left', 'top center', 'bottom right', 'top right',
|
||||||
|
// 'top left', 'bottom right', 'bottom left', 'top right', 'top right'
|
||||||
|
// ],
|
||||||
|
// }];
|
||||||
|
});
|
||||||
|
});
|
6
static/chevron-left.svg
Normal file
6
static/chevron-left.svg
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<!-- chevron-left icon by Free Icons (https://free-icons.github.io/free-icons/) -->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="1em" fill="currentColor" viewBox="0 0 512 512">
|
||||||
|
<path
|
||||||
|
d="M 126.86725663716814 249.20353982300884 Q 122.33628318584071 256 126.86725663716814 262.79646017699116 L 371.53982300884957 507.46902654867256 L 371.53982300884957 507.46902654867256 Q 378.3362831858407 512 385.13274336283183 507.46902654867256 Q 389.6637168141593 500.6725663716814 385.13274336283183 493.87610619469024 L 146.12389380530973 256 L 146.12389380530973 256 L 385.13274336283183 18.123893805309734 L 385.13274336283183 18.123893805309734 Q 389.6637168141593 11.327433628318584 385.13274336283183 4.530973451327434 Q 378.3362831858407 0 371.53982300884957 4.530973451327434 L 126.86725663716814 249.20353982300884 L 126.86725663716814 249.20353982300884 Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 875 B |
6
static/chevron-right.svg
Normal file
6
static/chevron-right.svg
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<!-- chevron-right icon by Free Icons (https://free-icons.github.io/free-icons/) -->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="1em" fill="currentColor" viewBox="0 0 512 512">
|
||||||
|
<path
|
||||||
|
d="M 385.13274336283183 249.20353982300884 Q 389.6637168141593 256 385.13274336283183 262.79646017699116 L 140.46017699115043 507.46902654867256 L 140.46017699115043 507.46902654867256 Q 133.6637168141593 512 126.86725663716814 507.46902654867256 Q 122.33628318584071 500.6725663716814 126.86725663716814 493.87610619469024 L 365.87610619469024 256 L 365.87610619469024 256 L 126.86725663716814 18.123893805309734 L 126.86725663716814 18.123893805309734 Q 122.33628318584071 11.327433628318584 126.86725663716814 4.530973451327434 Q 133.6637168141593 0 140.46017699115043 4.530973451327434 L 385.13274336283183 249.20353982300884 L 385.13274336283183 249.20353982300884 Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 877 B |
14
static/infinite-scroll.pkgd.min.js
vendored
Normal file
14
static/infinite-scroll.pkgd.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
static/jquery-3.7.1.min.js
vendored
Normal file
2
static/jquery-3.7.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
static/map.svg
Normal file
6
static/map.svg
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<!-- map icon by Free Icons (https://free-icons.github.io/free-icons/) -->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="1em" fill="currentColor" viewBox="0 0 512 512">
|
||||||
|
<path
|
||||||
|
d="M 160.88888888888889 57.77777777777778 Q 163.55555555555554 56.888888888888886 165.33333333333334 56.888888888888886 L 348.44444444444446 113.77777777777777 L 348.44444444444446 113.77777777777777 L 473.77777777777777 67.55555555555556 L 473.77777777777777 67.55555555555556 Q 488 63.111111111111114 499.55555555555554 71.11111111111111 Q 511.1111111111111 79.11111111111111 512 94.22222222222223 L 512 376 L 512 376 Q 511.1111111111111 395.55555555555554 493.3333333333333 402.6666666666667 L 351.1111111111111 455.1111111111111 L 351.1111111111111 455.1111111111111 Q 348.44444444444446 455.1111111111111 346.6666666666667 455.1111111111111 L 163.55555555555554 398.22222222222223 L 163.55555555555554 398.22222222222223 L 38.22222222222222 444.44444444444446 L 38.22222222222222 444.44444444444446 Q 24 448.8888888888889 12.444444444444445 440.8888888888889 Q 0.8888888888888888 432.8888888888889 0 417.77777777777777 L 0 136 L 0 136 Q 0.8888888888888888 116.44444444444444 18.666666666666668 109.33333333333333 L 160.88888888888889 57.77777777777778 L 160.88888888888889 57.77777777777778 Z M 24 122.66666666666667 Q 15.11111111111111 126.22222222222223 14.222222222222221 136 L 14.222222222222221 417.77777777777777 L 14.222222222222221 417.77777777777777 Q 14.222222222222221 424.8888888888889 20.444444444444443 429.3333333333333 Q 25.77777777777778 432.8888888888889 33.77777777777778 431.1111111111111 L 156.44444444444446 385.77777777777777 L 156.44444444444446 385.77777777777777 L 156.44444444444446 73.77777777777777 L 156.44444444444446 73.77777777777777 L 24 122.66666666666667 L 24 122.66666666666667 Z M 341.3333333333333 438.22222222222223 L 341.3333333333333 126.22222222222223 L 341.3333333333333 438.22222222222223 L 341.3333333333333 126.22222222222223 L 170.66666666666666 73.77777777777777 L 170.66666666666666 73.77777777777777 L 170.66666666666666 385.77777777777777 L 170.66666666666666 385.77777777777777 L 341.3333333333333 438.22222222222223 L 341.3333333333333 438.22222222222223 Z M 355.55555555555554 438.22222222222223 L 488.8888888888889 389.3333333333333 L 355.55555555555554 438.22222222222223 L 488.8888888888889 389.3333333333333 Q 496.8888888888889 385.77777777777777 497.77777777777777 376 L 497.77777777777777 94.22222222222223 L 497.77777777777777 94.22222222222223 Q 497.77777777777777 87.11111111111111 491.55555555555554 82.66666666666667 Q 486.22222222222223 79.11111111111111 479.1111111111111 80.88888888888889 L 355.55555555555554 126.22222222222223 L 355.55555555555554 126.22222222222223 L 355.55555555555554 438.22222222222223 L 355.55555555555554 438.22222222222223 Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
3879
static/plotly-3.0.1.min.js
vendored
Normal file
3879
static/plotly-3.0.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
264
xq/abv-mod.xqm
Normal file
264
xq/abv-mod.xqm
Normal file
|
@ -0,0 +1,264 @@
|
||||||
|
module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod';
|
||||||
|
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
declare namespace abv = "http://ossetic-studies.org/ns/abaevdict";
|
||||||
|
|
||||||
|
declare function abv-m:normalize-str($str as xs:string?)
|
||||||
|
as xs:string? {
|
||||||
|
$str => translate('
','') => normalize-space()
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function abv-m:sortKey($word as xs:string)
|
||||||
|
as xs:string {
|
||||||
|
$word => replace('-','')
|
||||||
|
=> replace('\(','')
|
||||||
|
=> replace('\)','')
|
||||||
|
=> replace('́','') (: combining acute :)
|
||||||
|
=> replace('\*','')
|
||||||
|
|
||||||
|
=> replace('a','/')
|
||||||
|
=> replace('A', '/')
|
||||||
|
=> replace('ā', '/')
|
||||||
|
=> replace('Ā', '/')
|
||||||
|
=> replace('á', '/')
|
||||||
|
=> replace('Á', '/')
|
||||||
|
=> replace('ā́', '/')
|
||||||
|
=> replace('Ā́', '/')
|
||||||
|
|
||||||
|
=> replace('æ', '1')
|
||||||
|
=> replace('Æ', '1')
|
||||||
|
=> replace('ǽ', '1')
|
||||||
|
=> replace('Ǽ', '1')
|
||||||
|
|
||||||
|
=> replace('b', '2')
|
||||||
|
=> replace('B', '2')
|
||||||
|
|
||||||
|
=> replace('cʼ', '4')
|
||||||
|
=> replace('Cʼ', '4')
|
||||||
|
|
||||||
|
=> replace('c', '3')
|
||||||
|
=> replace('C', '3')
|
||||||
|
|
||||||
|
=> replace('d', '5')
|
||||||
|
=> replace('D', '5')
|
||||||
|
|
||||||
|
=> replace('ʒ', '6')
|
||||||
|
=> replace('Ʒ', '6')
|
||||||
|
|
||||||
|
=> replace('e', '7')
|
||||||
|
=> replace('E', '7')
|
||||||
|
=> replace('é', '7')
|
||||||
|
=> replace('É', '7')
|
||||||
|
|
||||||
|
=> replace('f', '8')
|
||||||
|
=> replace('F', '8')
|
||||||
|
|
||||||
|
=> replace('g[˳₀ₒ]', '9')
|
||||||
|
=> replace('G[˳₀ₒ]', '9')
|
||||||
|
|
||||||
|
=> replace('g', '9')
|
||||||
|
=> replace('G', '9')
|
||||||
|
|
||||||
|
=> replace('ǵ', '9')
|
||||||
|
=> replace('Ǵ', '9')
|
||||||
|
|
||||||
|
=> replace('ǧ[˳₀ₒ]', 'A')
|
||||||
|
=> replace('Ǧ[˳₀ₒ]', 'A')
|
||||||
|
|
||||||
|
=> replace('ǧ', 'A')
|
||||||
|
=> replace('Ǧ', 'A')
|
||||||
|
|
||||||
|
=> replace('i', 'B')
|
||||||
|
=> replace('I', 'B')
|
||||||
|
=> replace('í', 'B')
|
||||||
|
=> replace('Í', 'B')
|
||||||
|
|
||||||
|
=> replace('ī', 'B')
|
||||||
|
=> replace('Ī', 'B')
|
||||||
|
=> replace('ī́', 'B')
|
||||||
|
=> replace('Ī́', 'B')
|
||||||
|
|
||||||
|
=> replace('j', 'D')
|
||||||
|
=> replace('J', 'D')
|
||||||
|
|
||||||
|
=> replace('kʼ[˳₀ₒ]', 'F')
|
||||||
|
=> replace('Kʼ[˳₀ₒ]', 'F')
|
||||||
|
|
||||||
|
=> replace('kʼ', 'F')
|
||||||
|
=> replace('Kʼ', 'F')
|
||||||
|
|
||||||
|
=> replace('k[˳₀ₒ]', 'E')
|
||||||
|
=> replace('K[˳₀ₒ]', 'E')
|
||||||
|
|
||||||
|
=> replace('k', 'E')
|
||||||
|
=> replace('K', 'E')
|
||||||
|
|
||||||
|
=> replace('ḱʼ', 'F')
|
||||||
|
=> replace('Ḱʼ', 'F')
|
||||||
|
|
||||||
|
=> replace('ḱ', 'E')
|
||||||
|
=> replace('Ḱ', 'E')
|
||||||
|
|
||||||
|
=> replace('l', 'H')
|
||||||
|
=> replace('L', 'H')
|
||||||
|
|
||||||
|
=> replace('m', 'I')
|
||||||
|
=> replace('M', 'I')
|
||||||
|
|
||||||
|
=> replace('n', 'J')
|
||||||
|
=> replace('N', 'J')
|
||||||
|
|
||||||
|
=> replace('o', 'K')
|
||||||
|
=> replace('O', 'K')
|
||||||
|
=> replace('ó', 'K')
|
||||||
|
=> replace('Ó', 'K')
|
||||||
|
|
||||||
|
=> replace('pʼ', 'M')
|
||||||
|
=> replace('Pʼ', 'M')
|
||||||
|
|
||||||
|
=> replace('p', 'L')
|
||||||
|
=> replace('P', 'L')
|
||||||
|
|
||||||
|
=> replace('q[˳₀ₒ]', 'N')
|
||||||
|
=> replace('Q[˳₀ₒ]', 'N')
|
||||||
|
|
||||||
|
=> replace('q', 'N')
|
||||||
|
=> replace('Q', 'N')
|
||||||
|
|
||||||
|
=> replace('r', 'O')
|
||||||
|
=> replace('R', 'O')
|
||||||
|
|
||||||
|
=> replace('s', 'P')
|
||||||
|
=> replace('S', 'P')
|
||||||
|
|
||||||
|
=> replace('tʼ', 'R')
|
||||||
|
=> replace('Tʼ', 'R')
|
||||||
|
|
||||||
|
=> replace('t', 'Q')
|
||||||
|
=> replace('T', 'Q')
|
||||||
|
|
||||||
|
=> replace('u', 'S')
|
||||||
|
=> replace('U', 'S')
|
||||||
|
=> replace('ú', 'S')
|
||||||
|
=> replace('Ú', 'S')
|
||||||
|
|
||||||
|
=> replace('ū', 'S')
|
||||||
|
=> replace('Ū', 'S')
|
||||||
|
=> replace('ū́', 'S')
|
||||||
|
=> replace('Ū́', 'S')
|
||||||
|
|
||||||
|
=> replace('v', 'T')
|
||||||
|
=> replace('V', 'T')
|
||||||
|
|
||||||
|
=> replace('w', 'U')
|
||||||
|
=> replace('W', 'U')
|
||||||
|
|
||||||
|
=> replace('x[˳₀ₒ]', 'V')
|
||||||
|
=> replace('X[˳₀ₒ]', 'V')
|
||||||
|
|
||||||
|
=> replace('x', 'V')
|
||||||
|
=> replace('X', 'V')
|
||||||
|
|
||||||
|
=> replace('y', 'W')
|
||||||
|
=> replace('Y', 'W')
|
||||||
|
=> replace('ý', 'W')
|
||||||
|
=> replace('Ý', 'W')
|
||||||
|
|
||||||
|
=> replace('z', 'X')
|
||||||
|
=> replace('Z', 'X')
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function abv-m:sort-collection($docs as document-node()+) {
|
||||||
|
sort($docs, (), function($d) {
|
||||||
|
abv-m:sortKey($d/tei:entry[1]/tei:form[1]/tei:orth[1]/text()[1]) })
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function abv-m:sort-nodes($docs as node()+) {
|
||||||
|
sort($docs, (), function($d) {
|
||||||
|
abv-m:sortKey($d/text()) })
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Apply XSL transformations to create a TEI-conformant <entry/> element,
|
||||||
|
or a sequence thereof :)
|
||||||
|
declare function abv-m:make-lng($src as document-node()+,
|
||||||
|
$lang as xs:string)
|
||||||
|
as node()+ {
|
||||||
|
for $doc in $src
|
||||||
|
let $del_lang := if ($lang = 'en') then 'ru' else 'en'
|
||||||
|
return ($doc => xslt:transform(doc('../xsl/strip-space.xsl'))
|
||||||
|
=> xslt:transform(doc('../xsl/delete-lang.xsl'),
|
||||||
|
{'lang': $del_lang})
|
||||||
|
=> xslt:transform(doc('../xsl/insert-refs.xsl'),
|
||||||
|
{'lookup-raw':
|
||||||
|
serialize(doc('abaevdict_index/lookup.xml')),
|
||||||
|
'biblio-raw':
|
||||||
|
serialize(doc('abaevdict_index/abaev_biblio.xml')),
|
||||||
|
'bib-lang': $lang})
|
||||||
|
=> xslt:transform(doc('../xsl/insert-langs.xsl'),
|
||||||
|
{'name-lang': $lang})
|
||||||
|
=> xslt:transform(doc('../xsl/standardize.xsl'),
|
||||||
|
{'standardize-lang': $lang})
|
||||||
|
=> xslt:transform(doc('../xsl/change-default-lang.xsl'),
|
||||||
|
{'default-lang': $lang}))/tei:TEI/tei:text/tei:body/tei:entry[1]
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function abv-m:insert-full-lang($abbr as node(), $lang as xs:string) {
|
||||||
|
let $flang := tokenize($abbr/@data-lang,',')
|
||||||
|
return $abbr transform with {
|
||||||
|
insert node attribute title {
|
||||||
|
string-join(doc('abaevdict_index/langnames.xml')/csv[1]/record[code/text() = $flang]/*[name()=$lang]/text(),', ')
|
||||||
|
} as first into .
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function abv-m:make-html($src as document-node()+,
|
||||||
|
$lang as xs:string)
|
||||||
|
as node()+ {
|
||||||
|
for $doc in $src
|
||||||
|
let $html := xslt:transform($doc,
|
||||||
|
doc('../xsl/abaev2html.xsl'), {'lang': $lang})
|
||||||
|
return $html transform with {for $abbr in //abbr
|
||||||
|
let $newabbr := abv-m:insert-full-lang($abbr,$lang)
|
||||||
|
return replace node $abbr with $newabbr}
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Function to generate a map for each mentioned in a document,
|
||||||
|
to be later fed to a geo map :)
|
||||||
|
declare function abv-m:make-geomap($doc as document-node(), $lang as xs:string) {
|
||||||
|
(: let $id := $doc/tei:entry/@xml:id :)
|
||||||
|
let $list := for $mlang in distinct-values($doc//tei:mentioned[not(tei:mentioned)]/@xml:lang)
|
||||||
|
let $ment := $doc//tei:mentioned[not(tei:mentioned) and @xml:lang=$mlang][1]
|
||||||
|
let $linfo := doc(`abaevdict_index/langnames.xml`)/csv[1]/record[code/text() = $mlang]
|
||||||
|
where $mlang != 'os'
|
||||||
|
and not(starts-with($mlang,'os-'))
|
||||||
|
and $linfo/long[1] != '-99'
|
||||||
|
and $linfo/lat[1] != '-99'
|
||||||
|
and $ment[tei:w]
|
||||||
|
return {
|
||||||
|
'text': ($ment/tei:w/text())[1],
|
||||||
|
'hovertext': string($linfo/*[name()=$lang][1]/text()),
|
||||||
|
'lon': xs:float($linfo/long[1]),
|
||||||
|
'lat': xs:float($linfo/lat[1])
|
||||||
|
}
|
||||||
|
let $map := map:merge(({'type': 'scattergeo',
|
||||||
|
'mode': 'markers+text',
|
||||||
|
'hoverinfo': 'text',
|
||||||
|
'textposition': 'top center',
|
||||||
|
'marker': {'size': 7,
|
||||||
|
'line': {'width': 1}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
for $k in map:keys($list[1])
|
||||||
|
let $seq := for $e in $list return $e($k)
|
||||||
|
return map:entry($k, array { $seq })))
|
||||||
|
|
||||||
|
return $map
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function abv-m:langname-by-id($id as xs:string, $lang as xs:string) {
|
||||||
|
doc('abaevdict_index/langnames.xml')/csv[1]/record[code/text()=$id]/*[name()=$lang]/text()
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function abv-m:entry-form-by-id($id as xs:string) {
|
||||||
|
doc(`abaevdict_index/lookup.xml`)/tei:table[1]/tei:entry[@xml:id=$id]/text()
|
||||||
|
};
|
12
xq/gen-lng-entries.xq
Normal file
12
xq/gen-lng-entries.xq
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
declare default element namespace "http://www.tei-c.org/ns/1.0";
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
declare namespace abv = "http://ossetic-studies.org/ns/abaevdict";
|
||||||
|
|
||||||
|
import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at './abv-mod.xqm';
|
||||||
|
|
||||||
|
let $langs := ('ru', 'en')
|
||||||
|
|
||||||
|
for $lang in $langs
|
||||||
|
for $doc in abv-m:make-lng(collection('abaevdict'), $lang)
|
||||||
|
let $id := $doc/@xml:id
|
||||||
|
return db:put(`abaevdict_{$lang}`, $doc, `xml/{$id}.xml`)
|
10
xq/gen-lng-html.xq
Normal file
10
xq/gen-lng-html.xq
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
declare namespace abv = "http://ossetic-studies.org/ns/abaevdict";
|
||||||
|
|
||||||
|
import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at './abv-mod.xqm';
|
||||||
|
|
||||||
|
let $langs := ('ru', 'en')
|
||||||
|
|
||||||
|
for $lang in $langs
|
||||||
|
for $doc in abv-m:make-html(collection(`abaevdict_{$lang}/xml`), $lang)
|
||||||
|
return db:put(`abaevdict_{$lang}`, $doc, `html/{$doc/article[1]/@id}.html`)
|
115
xq/gen-mentioned-index.xq
Normal file
115
xq/gen-mentioned-index.xq
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
declare namespace abv = "http://ossetic-studies.org/ns/abaevdict";
|
||||||
|
|
||||||
|
import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at './abv-mod.xqm';
|
||||||
|
|
||||||
|
declare function local:get-gloss($ment as node())
|
||||||
|
as xs:string* {
|
||||||
|
if (name($ment) = 'mentioned') then (
|
||||||
|
if (count($ment/tei:gloss) > 0)
|
||||||
|
then $ment/tei:gloss/tei:q/text()
|
||||||
|
else local:get-gloss($ment/..)
|
||||||
|
)
|
||||||
|
else ()
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function local:get-ment($ment as node(), $id as xs:string)
|
||||||
|
as map(xs:string, map(xs:string, map(xs:string, item()*)))* {
|
||||||
|
for $w in $ment/tei:w/text()
|
||||||
|
return map{$w : map{$id :
|
||||||
|
map {'gloss': local:get-gloss($ment),
|
||||||
|
'node': db:node-id($ment) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
declare variable $metalang external := 'en';
|
||||||
|
|
||||||
|
let $docs := collection(`abaevdict_{$metalang}/xml`)
|
||||||
|
(: let $docs := doc(`abaevdict_{$metalang}/xml/entry_mad.xml`) :)
|
||||||
|
|
||||||
|
(: Create sequence of isolated indices for each entry :)
|
||||||
|
let $langs-seq := for $doc in $docs
|
||||||
|
let $ments := $doc//tei:mentioned[tei:w]
|
||||||
|
let $id := $doc/tei:entry[1]/@xml:id
|
||||||
|
for $ment in $ments
|
||||||
|
return map:build($ment, keys := fn {./@xml:lang },
|
||||||
|
value := fn { local:get-ment(., $id) } )
|
||||||
|
|
||||||
|
(: Merge these sequences into one, creating a list containing duplicates :)
|
||||||
|
let $langs-merged := map:merge($langs-seq, {'duplicates': 'combine'})
|
||||||
|
|
||||||
|
(: For each word, merge occurrence information :)
|
||||||
|
let $langs-index := map:merge(
|
||||||
|
for $lang in map:keys($langs-merged)
|
||||||
|
let $words := map:merge($langs-merged($lang),
|
||||||
|
{'duplicates': 'combine'}
|
||||||
|
)
|
||||||
|
let $words-m := map:merge(for $w in map:keys($words)
|
||||||
|
return {$w: map:merge($words($w),
|
||||||
|
{'duplicates': 'combine'}
|
||||||
|
)})
|
||||||
|
|
||||||
|
return {$lang: $words-m}
|
||||||
|
)
|
||||||
|
|
||||||
|
(: Now we have to go through these languages and merge duplicates
|
||||||
|
for each of them :)
|
||||||
|
(: let $lang-index := map:merge(
|
||||||
|
for $lang in map:keys($langs-merged)
|
||||||
|
let $linfo := map:merge($langs-merged($lang),
|
||||||
|
{'duplicates': 'combine'})
|
||||||
|
let $linfo-m := map:merge(
|
||||||
|
for $w in map:keys($linfo)
|
||||||
|
return map{$w: {'entries':
|
||||||
|
distinct-values($winfo('entries')),
|
||||||
|
'glosses':
|
||||||
|
distinct-values($winfo('glosses'))}}
|
||||||
|
)
|
||||||
|
return {$lang: $linfo-m}
|
||||||
|
) :)
|
||||||
|
|
||||||
|
(: return $langs-index :)
|
||||||
|
|
||||||
|
(: for $lang in map:keys($lang-index)
|
||||||
|
for $w in map:keys($lang-index($lang))
|
||||||
|
where count($lang-index($lang)($w)('entries')) > 1
|
||||||
|
return ($lang,$w, $lang-index($lang)($w)) :)
|
||||||
|
|
||||||
|
|
||||||
|
return
|
||||||
|
<lang-index>
|
||||||
|
{
|
||||||
|
for $lang in map:keys($langs-index)
|
||||||
|
let $words := $langs-index($lang)
|
||||||
|
order by abv-m:langname-by-id($lang, $metalang)
|
||||||
|
return
|
||||||
|
<lang id='{$lang}'>
|
||||||
|
{
|
||||||
|
for $w in map:keys($words)
|
||||||
|
let $wn := abv-m:normalize-str($w)
|
||||||
|
order by $wn
|
||||||
|
return
|
||||||
|
<word text="{$wn}">
|
||||||
|
{
|
||||||
|
for $e in map:keys($words($w))
|
||||||
|
return
|
||||||
|
<entry id="{$e}">
|
||||||
|
{
|
||||||
|
for $ref in $words($w)($e)
|
||||||
|
return
|
||||||
|
<ref node-id="{$ref('node')}">
|
||||||
|
{
|
||||||
|
for $g in $ref('gloss')
|
||||||
|
return
|
||||||
|
if ($g != '') then <gloss text="{$g}"/> else ()
|
||||||
|
}
|
||||||
|
</ref>
|
||||||
|
}
|
||||||
|
</entry>
|
||||||
|
}
|
||||||
|
</word>
|
||||||
|
}
|
||||||
|
</lang>
|
||||||
|
}
|
||||||
|
</lang-index>
|
24
xq/make-lookup.xq
Normal file
24
xq/make-lookup.xq
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
declare default element namespace "http://www.tei-c.org/ns/1.0";
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
declare namespace abv = "http://ossetic-studies.org/ns/abaevdict";
|
||||||
|
|
||||||
|
declare function local:genLookupEntry($doc as document-node())
|
||||||
|
as element()?
|
||||||
|
{
|
||||||
|
let $node := $doc/tei:TEI/tei:text/tei:body/tei:entry
|
||||||
|
let $phon := $node/tei:form[1]/tei:orth[1]/text()[1]
|
||||||
|
|
||||||
|
return element entry {
|
||||||
|
attribute xml:id { $node/@xml:id },
|
||||||
|
attribute filename { db:path($doc) },
|
||||||
|
if ($node/@n) then attribute n {$node/@n} else (),
|
||||||
|
text { $phon }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let $tbl := <table>
|
||||||
|
{for $doc in collection('abaevdict')
|
||||||
|
return local:genLookupEntry($doc)}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
return db:put('abaevdict_index', $tbl, 'lookup.xml')
|
4
xq/parse-langnames.xq
Normal file
4
xq/parse-langnames.xq
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
let $text := file:read-text('./basex/webapp/csv/langnames.csv')
|
||||||
|
return db:put('abaevdict_index',
|
||||||
|
csv:parse($text, { 'header': true() }),
|
||||||
|
'langnames.xml')
|
175
xq/restx_api.xq
Normal file
175
xq/restx_api.xq
Normal file
|
@ -0,0 +1,175 @@
|
||||||
|
declare namespace api = 'http://ossetic-studies.org/ns/abaevdict-api';
|
||||||
|
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
|
||||||
|
import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at './abv-mod.xqm';
|
||||||
|
|
||||||
|
(: ======================================================= :)
|
||||||
|
(: ==================== API STUFF ======================== :)
|
||||||
|
(: ======================================================= :)
|
||||||
|
|
||||||
|
declare option output:method 'json';
|
||||||
|
declare option output:json "format=xquery";
|
||||||
|
|
||||||
|
declare variable $langs-index := doc('abaevdict_index/langnames.xml');
|
||||||
|
declare variable $lookup := doc('abaevdict_index/lookup.xml');
|
||||||
|
|
||||||
|
(: Get the mentioned index for the right metalanguage :)
|
||||||
|
declare function api:ment-index($db-lang as xs:string) {
|
||||||
|
doc(`abaevdict_index/mentioned_{$db-lang}.xml`)
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Short entry info (only forms for now). Hash is used because URLs don't handle
|
||||||
|
some Unicode characters very well in this system :)
|
||||||
|
declare function api:entry-info-short($n as node())
|
||||||
|
as map(xs:string, xs:string) {
|
||||||
|
map{'id': string(hash($n/@xml:id)), 'xmlid': $n/@xml:id, 'form': $n/text()}
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Short language info -- for the language list :)
|
||||||
|
declare function api:lang-info-short($n as node(), $db-lang as xs:string) {
|
||||||
|
map{
|
||||||
|
'id': $n/code/text(),
|
||||||
|
'glottolog': $n/glottolog/text(),
|
||||||
|
'name': map{'full': if ($db-lang = 'ru') then $n/ru/text() else $n/en/text(),
|
||||||
|
'abbr': if ($db-lang = 'ru') then $n/ru/text() else $n/en_abbr/text()}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Longer info -- for individual languages :)
|
||||||
|
declare function api:lang-info-full($n as node(), $db-lang as xs:string) {
|
||||||
|
map:merge(
|
||||||
|
(api:lang-info-short($n, $db-lang),
|
||||||
|
map{'words':
|
||||||
|
array:build(api:ment-index($db-lang)/lang-index[1]/lang[@id=$n/code]/word,
|
||||||
|
api:word-info-short#1)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function api:word-info-short($n as node()) {
|
||||||
|
let $text := xs:string($n/@text)
|
||||||
|
return map{
|
||||||
|
(: I am using a hash function as ID, because the words are uniquely
|
||||||
|
identified within a language by their text. And the mentioned index is not
|
||||||
|
persistent enough (at least yet) to use persistent ids :)
|
||||||
|
'id': string(hash($text)),
|
||||||
|
'text': $text
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
declare function api:word-info-long($n as node()) {
|
||||||
|
map:merge(
|
||||||
|
(
|
||||||
|
api:word-info-short($n),
|
||||||
|
map{
|
||||||
|
'entries': array:build($n/entry,
|
||||||
|
fn {
|
||||||
|
map{'id': string(hash(./@id)),
|
||||||
|
'xmlid': string(./@id),
|
||||||
|
'refs': array:build(./ref,
|
||||||
|
fn {
|
||||||
|
map:merge((
|
||||||
|
map:entry('node-id', string(./@node-id)),
|
||||||
|
if(./gloss) then
|
||||||
|
{'glosses': array:build(distinct-values(./gloss/@text), string#1)}
|
||||||
|
else ()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(: 'nodes': array:build(string($n/ref/@node-id)),
|
||||||
|
'glosses': array:build(string($n/gloss/@text)) :)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
(: RETURN JSON FOR PLOTLY MAP :)
|
||||||
|
(: English as default language :)
|
||||||
|
declare %rest:path("dict/map-info/{$entry}")
|
||||||
|
%rest:GET
|
||||||
|
function api:map-info($entry) {
|
||||||
|
(: In this case we do not redirect, but simply give the JSON via
|
||||||
|
another function :)
|
||||||
|
api:map-info('en', $entry)
|
||||||
|
};
|
||||||
|
|
||||||
|
(: This has to be remade to use the /api path. But keep it like this for now :)
|
||||||
|
declare %rest:path("{$lang}/dict/map-info/{$entry}")
|
||||||
|
%rest:GET
|
||||||
|
function api:map-info($lang, $entry) {
|
||||||
|
let $ments := abv-m:make-geomap(doc(`abaevdict_{$lang}/xml/{$entry}.xml`),
|
||||||
|
$lang)
|
||||||
|
return $ments
|
||||||
|
};
|
||||||
|
|
||||||
|
(: API FOR THE MENTIONED INDEX :)
|
||||||
|
(: Default to English :)
|
||||||
|
declare %rest:path("/api/{$path=.+}")
|
||||||
|
%rest:GET
|
||||||
|
function api:default($path as xs:string) {
|
||||||
|
web:forward(`/en/api/{$path}`)
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Get languages :)
|
||||||
|
declare %rest:path("{$db-lang}/api/languages")
|
||||||
|
%rest:GET
|
||||||
|
function api:langs($db-lang as xs:string := 'en') {
|
||||||
|
array:build(
|
||||||
|
$langs-index/csv[1]/record,
|
||||||
|
api:lang-info-short(?,$db-lang)
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Get one language :)
|
||||||
|
declare %rest:path("{$db-lang}/api/languages/{$lang}")
|
||||||
|
%rest:GET
|
||||||
|
function api:langs-lang($db-lang as xs:string, $lang as xs:string) {
|
||||||
|
api:lang-info-full(
|
||||||
|
$langs-index/csv[1]/record[code=$lang], $db-lang
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Get words for a language :)
|
||||||
|
declare %rest:path("{$db-lang}/api/languages/{$lang}/words")
|
||||||
|
%rest:GET
|
||||||
|
function api:langs-lang-words($db-lang as xs:string, $lang as xs:string) {
|
||||||
|
array:build(api:ment-index($db-lang)/lang-index[1]/lang[@id=$lang]/word,
|
||||||
|
api:word-info-short#1)
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Get info on a particular word.
|
||||||
|
Db-lang is a placeholder, it does nothing here, used only for consistency :)
|
||||||
|
declare %rest:path("{$db-lang}/api/languages/{$lang}/words/{$word-id}")
|
||||||
|
%rest:GET
|
||||||
|
function api:langs-lang-words-word($db-lang as xs:string,
|
||||||
|
$lang as xs:string,
|
||||||
|
$word-id as xs:string) {
|
||||||
|
api:word-info-long(
|
||||||
|
api:ment-index($db-lang)/lang-index[1]/lang[@id=$lang]/word[string(hash(@text))=$word-id]
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Entry info (only form for now) :)
|
||||||
|
declare %rest:path("{$db-lang}/api/entries")
|
||||||
|
%rest:GET
|
||||||
|
function api:entries($db-lang as xs:string) {
|
||||||
|
array:build(
|
||||||
|
$lookup/tei:table[1]/tei:entry,
|
||||||
|
api:entry-info-short#1
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
declare %rest:path("{$db-lang}/api/entries/{$entry-id}")
|
||||||
|
%rest:GET
|
||||||
|
function api:entries($db-lang as xs:string,
|
||||||
|
$entry-id as xs:string) {
|
||||||
|
api:entry-info-short(
|
||||||
|
$lookup/tei:table[1]/tei:entry[string(hash(@xml:id))=$entry-id])
|
||||||
|
};
|
||||||
|
|
||||||
|
0
|
122
xq/restx_dict.xq.old
Normal file
122
xq/restx_dict.xq.old
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
module namespace page = 'http://ossetic-studies.org/ns/abaevdict-site';
|
||||||
|
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
|
||||||
|
import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at './abv-mod.xqm';
|
||||||
|
|
||||||
|
declare variable $page:items as xs:integer := 20;
|
||||||
|
|
||||||
|
declare %rest:path("{$lang}/dict/page{$p}")
|
||||||
|
(: %rest:GET :)
|
||||||
|
%output:method("html")
|
||||||
|
%output:html-version('5')
|
||||||
|
function page:dict($lang, $p) {
|
||||||
|
let $pagetotal := ceiling(count(collection('abaevdict_en')) div $page:items)
|
||||||
|
let $sorted := abv-m:sort-collection(collection(`abaevdict_{$lang}`))
|
||||||
|
return
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script src="/static/jquery-3.7.1.min.js">
|
||||||
|
</script>
|
||||||
|
<script src="/static/infinite-scroll.pkgd.min.js">
|
||||||
|
</script>
|
||||||
|
<script src="/static/plotly-3.0.1.min.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script src="/static/abaev.js"></script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css"/>
|
||||||
|
<link rel="stylesheet" href="{web:create-url('/static/abaev-html.css')}"/>
|
||||||
|
<title>Abaev</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Abaevdict</strong></li>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#">Home</a></li>
|
||||||
|
<li><a href="#">Dictionary</a></li>
|
||||||
|
<li><a href="#">Index</a></li>
|
||||||
|
<li><a href="#">References</a></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<button id="open-leftbar">
|
||||||
|
{html:doc('../static/chevron-right.svg')}
|
||||||
|
</button>
|
||||||
|
<button id="close-leftbar">
|
||||||
|
{html:doc('../static/chevron-left.svg')}
|
||||||
|
</button>
|
||||||
|
<aside id="leftbar">
|
||||||
|
<input type="text" id="filter-entries" placeholder="Quick filter…"/>
|
||||||
|
<nav id="entrylist">
|
||||||
|
<ul>
|
||||||
|
{for $doc in $sorted
|
||||||
|
return <li id="link_{$doc/tei:entry[1]/@xml:id}">
|
||||||
|
<a href="by-id/{$doc/tei:entry[1]/@xml:id}">
|
||||||
|
{$doc/tei:entry[1]/tei:form[1]/tei:orth[1]/text()}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
<main>
|
||||||
|
{for $doc at $i in $sorted
|
||||||
|
where $i > ($p - 1) * $page:items and $i <= $p * $page:items
|
||||||
|
let $html := xslt:transform($doc,
|
||||||
|
doc('../xsl/abaev2html.xsl'), {'lang': $lang})
|
||||||
|
return $html}
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
<nav class="pagination">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
{if ($p > 1) then <a href="page{$p - 1}">Previous page</a> else ()}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!-- <ul><li>Page {$p} of {$pagetotal}</li></ul> -->
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
{if ($p < $pagetotal) then
|
||||||
|
<a class="pagination__next" href="page{$p + 1}">Next page</a> else ()}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<dialog id="modal_map">
|
||||||
|
<article>
|
||||||
|
<header><button class="abv-close-map" aria-label="Close" rel="prev"></button>
|
||||||
|
<p>Map</p>
|
||||||
|
</header>
|
||||||
|
<p>
|
||||||
|
<div id="map_display" style="width:100%;height:80%;"></div>
|
||||||
|
</p>
|
||||||
|
<footer><button class="abv-close-map">Close</button></footer>
|
||||||
|
</article>
|
||||||
|
</dialog>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
};
|
||||||
|
|
||||||
|
declare %rest:path("{$lang}/dict/by-id/{$id}")
|
||||||
|
(: %rest:GET :)
|
||||||
|
%output:method("html")
|
||||||
|
%output:html-version('5')
|
||||||
|
function page:by-id($lang, $id) {
|
||||||
|
|
||||||
|
let $seq := abv-m:sort-collection(collection(`abaevdict_{$lang}`))
|
||||||
|
let $doc-index := index-of($seq, $seq[tei:entry[@xml:id=`{$id}`]])
|
||||||
|
let $pagenum := ceiling($doc-index div $page:items)
|
||||||
|
return web:redirect(`../page{$pagenum}`, {}, web:decode-url($id))
|
||||||
|
};
|
||||||
|
|
||||||
|
declare %rest:path("{$lang}/dict/map-info/{$entry}")
|
||||||
|
%rest:produces("application/json")
|
||||||
|
%rest:GET function page:map-info($lang, $entry) {
|
||||||
|
let $ments := abv-m:make-geomap(doc(`abaevdict_{$lang}/{$entry}.xml`),
|
||||||
|
$lang)
|
||||||
|
return json:serialize($ments, {'format': 'xquery'})
|
||||||
|
};
|
219
xq/restx_dict_cached.xq
Normal file
219
xq/restx_dict_cached.xq
Normal file
|
@ -0,0 +1,219 @@
|
||||||
|
module namespace page = 'http://ossetic-studies.org/ns/abaevdict-site';
|
||||||
|
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
|
||||||
|
import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at './abv-mod.xqm';
|
||||||
|
|
||||||
|
(: =========================================================== :)
|
||||||
|
(: ================== GLOBAL VARIABLES ======================= :)
|
||||||
|
(: =========================================================== :)
|
||||||
|
|
||||||
|
(: Number of items per page :)
|
||||||
|
declare variable $page:items as xs:integer := 20;
|
||||||
|
|
||||||
|
(: These variables are declared in module scope because they are needed in
|
||||||
|
different places, but they are still dynamically evaluated :)
|
||||||
|
declare variable $page:lookup := doc('abaevdict_index/lookup.xml')/tei:table/tei:entry;
|
||||||
|
declare variable $page:total := ceiling(count($page:lookup) div $page:items);
|
||||||
|
declare variable $page:sorted := abv-m:sort-nodes($page:lookup);
|
||||||
|
|
||||||
|
(: =============================================================== :)
|
||||||
|
(: ======================= COMMON STUFF ========================== :)
|
||||||
|
(: =============================================================== :)
|
||||||
|
|
||||||
|
declare function page:head($title as xs:string, $script as node()* := ()) {
|
||||||
|
<head>
|
||||||
|
<script src="/static/jquery-3.7.1.min.js">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css"/>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="{web:create-url('/static/abaev-html.css')}"/>
|
||||||
|
|
||||||
|
{$script}
|
||||||
|
|
||||||
|
<title>{$title}</title>
|
||||||
|
</head>
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Navigation header :)
|
||||||
|
declare function page:header() {
|
||||||
|
<header>
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Abaevdict</strong></li>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li><a href="./home">Home</a></li>
|
||||||
|
<li><a href="./dict">Dictionary</a></li>
|
||||||
|
<li><a href="./index">Index</a></li>
|
||||||
|
<li><a href="#">References</a></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
};
|
||||||
|
|
||||||
|
(: =============================================================== :)
|
||||||
|
(: ======================= THE PAGES ============================= :)
|
||||||
|
(: =============================================================== :)
|
||||||
|
|
||||||
|
(: If no language defined, default to English :)
|
||||||
|
declare %rest:path("dict")
|
||||||
|
%output:method("html")
|
||||||
|
%output:html-version('5')
|
||||||
|
function page:dict() {
|
||||||
|
web:forward('/en/dict')
|
||||||
|
};
|
||||||
|
|
||||||
|
(: The main dictionary view :)
|
||||||
|
declare %rest:path("{$lang}/dict")
|
||||||
|
%rest:query-param("page","{$p}", 1)
|
||||||
|
%output:method("html")
|
||||||
|
%output:html-version('5')
|
||||||
|
function page:dict($lang, $p) {
|
||||||
|
<html>
|
||||||
|
{page:head('HEDO – Dictionary',
|
||||||
|
(<script src="/static/infinite-scroll.pkgd.min.js">
|
||||||
|
</script>,
|
||||||
|
<script src="/static/plotly-3.0.1.min.js" charset="utf-8"></script>,
|
||||||
|
<script src="/static/abaev.js"></script>))}
|
||||||
|
|
||||||
|
<body>
|
||||||
|
{page:header()}
|
||||||
|
|
||||||
|
<!-- Sidebar with entry list -->
|
||||||
|
<button id="open-leftbar">
|
||||||
|
{html:doc('../static/chevron-right.svg')}
|
||||||
|
</button>
|
||||||
|
<button id="close-leftbar">
|
||||||
|
{html:doc('../static/chevron-left.svg')}
|
||||||
|
</button>
|
||||||
|
<aside id="leftbar">
|
||||||
|
<input type="text" id="filter-entries" placeholder="Quick filter…"/>
|
||||||
|
<nav id="entrylist">
|
||||||
|
<ul>
|
||||||
|
{for $doc in $page:sorted
|
||||||
|
return <li id="link_{$doc/@xml:id}">
|
||||||
|
<a href="./dict/{$doc/@xml:id}">
|
||||||
|
{$doc/text()}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<!-- The dictionary itself. The entries are displayed as articles retrieved
|
||||||
|
from the database in HTML. On-the-fly generation is only when required -->
|
||||||
|
<main>
|
||||||
|
{for $doc at $i in $page:sorted
|
||||||
|
where $i > ($p - 1) * $page:items and $i <= $p * $page:items
|
||||||
|
let $html := doc(`abaevdict_{$lang}/html/{$doc/@xml:id}.html`)
|
||||||
|
return $html}
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<!-- Footer for page navigation -->
|
||||||
|
<footer>
|
||||||
|
<nav class="pagination">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
{if ($p > 1) then <a href="?page={$p - 1}">Previous page</a> else ()}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!-- <ul><li>Page {$p} of {$page:total}</li></ul> -->
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
{if ($p < $page:total) then
|
||||||
|
<a class="pagination__next" href="?page={$p + 1}">Next page</a> else ()}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<!-- Modal for map display -->
|
||||||
|
<dialog id="modal_map">
|
||||||
|
<article>
|
||||||
|
<header><button class="abv-close-map" aria-label="Close" rel="prev"></button>
|
||||||
|
<p>Map</p>
|
||||||
|
</header>
|
||||||
|
<p>
|
||||||
|
<div id="map_display" style="width:100%;height:80%;"></div>
|
||||||
|
</p>
|
||||||
|
<footer><button class="abv-close-map">Close</button></footer>
|
||||||
|
</article>
|
||||||
|
</dialog>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
};
|
||||||
|
|
||||||
|
(: == ENTRY BY ID == :)
|
||||||
|
(: English as default language :)
|
||||||
|
declare %rest:path("dict/{$id}")
|
||||||
|
%output:method("html")
|
||||||
|
%output:html-version('5')
|
||||||
|
function page:by-id($id) {
|
||||||
|
page:by-id('en',$id)
|
||||||
|
};
|
||||||
|
|
||||||
|
declare %rest:path("{$lang}/dict/{$id}")
|
||||||
|
%output:method("html")
|
||||||
|
%output:html-version('5')
|
||||||
|
function page:by-id($lang, $id) {
|
||||||
|
let $doc-index := index-of($page:sorted, $page:sorted[@xml:id=`{$id}`])
|
||||||
|
let $pagenum := ceiling($doc-index div $page:items)
|
||||||
|
return web:redirect('../dict', {'page': $pagenum}, web:decode-url($id))
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Mentioned index :)
|
||||||
|
declare %rest:path("{$lang}/index")
|
||||||
|
%output:method("html")
|
||||||
|
%output:html-version('5')
|
||||||
|
function page:index($lang) {
|
||||||
|
let $mlangs := doc(`abaevdict_index/langnames.xml`)/csv[1]/record
|
||||||
|
return
|
||||||
|
<html>
|
||||||
|
{page:head('HEDO – Index', <script src="/static/abaev-index.js"></script>)}
|
||||||
|
<body>
|
||||||
|
{page:header()}
|
||||||
|
<main>
|
||||||
|
<div class="index">
|
||||||
|
<div class="langs">
|
||||||
|
<label>Languages</label>
|
||||||
|
<select id="abv-select-lang" size="99999">
|
||||||
|
{
|
||||||
|
for $mlang in $mlangs
|
||||||
|
let $mlang-id := $mlang/code/text()
|
||||||
|
let $mlang-name := if ($lang = 'ru') then $mlang/ru/text() else $mlang/en/text()
|
||||||
|
where $mlang-name != ''
|
||||||
|
return
|
||||||
|
<option value="{$mlang-id}">
|
||||||
|
{
|
||||||
|
$mlang-name
|
||||||
|
}
|
||||||
|
</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="forms">
|
||||||
|
<Label>Forms</Label>
|
||||||
|
<select id="abv-select-word" size="99999">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="entries">
|
||||||
|
<Label>Entries</Label>
|
||||||
|
<select id="abv-select-entry" size="99999">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
};
|
||||||
|
|
||||||
|
(: Default to English :)
|
||||||
|
declare %rest:path("index")
|
||||||
|
%output:method("html")
|
||||||
|
%output:html-version('5')
|
||||||
|
function page:index() {
|
||||||
|
page:index('en')
|
||||||
|
};
|
60
xq/test.xq
Normal file
60
xq/test.xq
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
declare namespace tei = "http://www.tei-c.org/ns/1.0";
|
||||||
|
declare namespace abv = "http://ossetic-studies.org/ns/abaevdict";
|
||||||
|
|
||||||
|
import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at './abv-mod.xqm';
|
||||||
|
|
||||||
|
let $doc := db:get('abaevdict_en','/xml/entry_az.xml')
|
||||||
|
return string(abv-m:make-html($doc, 'ru')/article[1]/@id)
|
||||||
|
(: let $nid := db:node-id($doc/tei:entry[1]/tei:note[1]) :)
|
||||||
|
(: return $nid :)
|
||||||
|
(: return xquery:eval('declare namespace tei = "http://www.tei-c.org/ns/1.0";//tei:note',{'': $doc}) :)
|
||||||
|
|
||||||
|
(: abv-m:make-html(doc('abaevdict_en/xml/entry_sæpp.xml'), 'en') :)
|
||||||
|
|
||||||
|
(: db:node-id(db:get-id('abaevdict_index',1307388)) :)
|
||||||
|
|
||||||
|
(: import module namespace api = 'http://ossetic-studies.org/ns/abaevdict-api' at './restx_api.xq'; :)
|
||||||
|
|
||||||
|
(: abv-m:make-html(doc('abaevdict_en/xml/entry_az.xml')//tei:mentioned,'en') :)
|
||||||
|
|
||||||
|
(: abv-m:langname-by-id('inc-x-old-vaidika','en') :)
|
||||||
|
|
||||||
|
(: SERIALIZE AS JSONML :)
|
||||||
|
(: json:serialize(doc('abaevdict_index/mentioned.xml'), {'format': 'jsonml'}) :)
|
||||||
|
|
||||||
|
(: GENERATE MENTIONED INDEX :)
|
||||||
|
(: let $langs := ('en', 'ru')
|
||||||
|
for $lang in $langs
|
||||||
|
let $index := xquery:eval(xs:anyURI('gen-mentioned-index.xq'), {'metalang': $lang})
|
||||||
|
return db:put('abaevdict_index', $index, `mentioned_{$lang}.xml`) :)
|
||||||
|
|
||||||
|
(: GENERATE ENGLISH/RUSSIAN TEI FOR ONE ENTRY :)
|
||||||
|
(: let $langs := ('en','ru')
|
||||||
|
for $lang in $langs
|
||||||
|
for $doc in abv-m:make-lng(doc('abaevdict/abaev_-ston.xml'), $lang)
|
||||||
|
let $id := $doc/@xml:id
|
||||||
|
return db:put(`abaevdict_{$lang}`, $doc, `xml/{$id}.xml`) :)
|
||||||
|
|
||||||
|
(: GENERATE HTML FOR ONE ENTRY :)
|
||||||
|
(: let $langs := ('en','ru')
|
||||||
|
for $lang in $langs
|
||||||
|
let $doc := abv-m:make-html(doc(`abaevdict_{$lang}/xml/entry_-ston.xml`), $lang)
|
||||||
|
let $id := $doc/article[1]/@id
|
||||||
|
return db:put(`abaevdict_{$lang}`, $doc, `html/{$id}.html`) :)
|
||||||
|
|
||||||
|
(: TEST HTML GEN :)
|
||||||
|
(: abv-m:make-html(doc('abaevdict_en/xml/entry_abūxyn.xml'),'en') :)
|
||||||
|
|
||||||
|
(: GENERATE ENGLISH/RUSSIAN HTML :)
|
||||||
|
(: for $doc in abv-m:make-html(collection('abaevdict_ru/xml'), 'ru')
|
||||||
|
return db:put('abaevdict_ru', $doc, `html/{$doc/article[1]/@id}.html`) :)
|
||||||
|
|
||||||
|
(: TEST GEOMAP FOR ONE ENTRY :)
|
||||||
|
(: let $doc := doc('abaevdict_en/entry_maryn.xml')
|
||||||
|
return abv-m:make-geomap($doc,'en') :)
|
||||||
|
|
||||||
|
(: PARSE CSV OF LANGNAMES. IF I WILL EVER NEED IT :)
|
||||||
|
(: let $text := file:read-text('./basex/webapp/csv/langnames.csv')
|
||||||
|
return db:put('abaevdict_index',
|
||||||
|
csv:parse($text, { 'header': true() }),
|
||||||
|
'langnames.xml') :)
|
322
xsl/abaev2html.xsl
Normal file
322
xsl/abaev2html.xsl
Normal file
|
@ -0,0 +1,322 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
||||||
|
xmlns:abv="http://ossetic-studies.org/ns/abaevdict"
|
||||||
|
exclude-result-prefixes="xs tei"
|
||||||
|
version="2.0">
|
||||||
|
<xsl:output method="xml"/>
|
||||||
|
|
||||||
|
<!-- Which language we are using for the final output -->
|
||||||
|
<xsl:param name="lang"/>
|
||||||
|
|
||||||
|
<!-- Function that recursively produces a sequence of languages -->
|
||||||
|
<xsl:function name="abv:getlangs" as="xs:string+">
|
||||||
|
<xsl:param name="node" as="node()"/>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$node/@xml:lang">
|
||||||
|
<xsl:sequence select="($node/@xml:lang, tokenize($node/@extralang,','))"/>
|
||||||
|
<!-- <xsl:value-of select="($node/@xml:lang,$node/@extralang)"/> -->
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:sequence select="abv:getlangs($node/..)"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:function>
|
||||||
|
|
||||||
|
<xsl:template match="tei:entry">
|
||||||
|
<xsl:variable name="entry-id" select="@xml:id"/>
|
||||||
|
<xsl:element name="article">
|
||||||
|
<xsl:attribute name="id" select="$entry-id"/>
|
||||||
|
<xsl:attribute name="lang" select="$lang"/>
|
||||||
|
<xsl:attribute name="class">abv-entry</xsl:attribute>
|
||||||
|
<xsl:variable name="position">0</xsl:variable>
|
||||||
|
|
||||||
|
<!-- Split into two groups: the headword div and the rest -->
|
||||||
|
<xsl:for-each-group select="*" group-adjacent="self::tei:form or
|
||||||
|
(self::tei:pc and following-sibling::*[1][self::tei:form])">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="current-grouping-key()">
|
||||||
|
<h6 class="abv-headword">
|
||||||
|
<xsl:apply-templates select="current-group()"/>
|
||||||
|
<br/>
|
||||||
|
<a class="abv-map" href="#modal_map">
|
||||||
|
<xsl:attribute name="data-abv-entry" select="$entry-id"/>
|
||||||
|
<!-- map icon by Free Icons (https://free-icons.github.io/free-icons/) -->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="1em" fill="currentColor" viewBox="0 0 512 512">
|
||||||
|
<path
|
||||||
|
d="M 160.88888888888889 57.77777777777778 Q 163.55555555555554 56.888888888888886 165.33333333333334 56.888888888888886 L 348.44444444444446 113.77777777777777 L 348.44444444444446 113.77777777777777 L 473.77777777777777 67.55555555555556 L 473.77777777777777 67.55555555555556 Q 488 63.111111111111114 499.55555555555554 71.11111111111111 Q 511.1111111111111 79.11111111111111 512 94.22222222222223 L 512 376 L 512 376 Q 511.1111111111111 395.55555555555554 493.3333333333333 402.6666666666667 L 351.1111111111111 455.1111111111111 L 351.1111111111111 455.1111111111111 Q 348.44444444444446 455.1111111111111 346.6666666666667 455.1111111111111 L 163.55555555555554 398.22222222222223 L 163.55555555555554 398.22222222222223 L 38.22222222222222 444.44444444444446 L 38.22222222222222 444.44444444444446 Q 24 448.8888888888889 12.444444444444445 440.8888888888889 Q 0.8888888888888888 432.8888888888889 0 417.77777777777777 L 0 136 L 0 136 Q 0.8888888888888888 116.44444444444444 18.666666666666668 109.33333333333333 L 160.88888888888889 57.77777777777778 L 160.88888888888889 57.77777777777778 Z M 24 122.66666666666667 Q 15.11111111111111 126.22222222222223 14.222222222222221 136 L 14.222222222222221 417.77777777777777 L 14.222222222222221 417.77777777777777 Q 14.222222222222221 424.8888888888889 20.444444444444443 429.3333333333333 Q 25.77777777777778 432.8888888888889 33.77777777777778 431.1111111111111 L 156.44444444444446 385.77777777777777 L 156.44444444444446 385.77777777777777 L 156.44444444444446 73.77777777777777 L 156.44444444444446 73.77777777777777 L 24 122.66666666666667 L 24 122.66666666666667 Z M 341.3333333333333 438.22222222222223 L 341.3333333333333 126.22222222222223 L 341.3333333333333 438.22222222222223 L 341.3333333333333 126.22222222222223 L 170.66666666666666 73.77777777777777 L 170.66666666666666 73.77777777777777 L 170.66666666666666 385.77777777777777 L 170.66666666666666 385.77777777777777 L 341.3333333333333 438.22222222222223 L 341.3333333333333 438.22222222222223 Z M 355.55555555555554 438.22222222222223 L 488.8888888888889 389.3333333333333 L 355.55555555555554 438.22222222222223 L 488.8888888888889 389.3333333333333 Q 496.8888888888889 385.77777777777777 497.77777777777777 376 L 497.77777777777777 94.22222222222223 L 497.77777777777777 94.22222222222223 Q 497.77777777777777 87.11111111111111 491.55555555555554 82.66666666666667 Q 486.22222222222223 79.11111111111111 479.1111111111111 80.88888888888889 L 355.55555555555554 126.22222222222223 L 355.55555555555554 126.22222222222223 L 355.55555555555554 438.22222222222223 L 355.55555555555554 438.22222222222223 Z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
</h6>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<!-- Further split into usg 9i.e. dialect marking) and rest -->
|
||||||
|
<xsl:for-each-group select="current-group()"
|
||||||
|
group-adjacent="self::tei:usg or (self::tei:pc and following-sibling::*[1][self::tei:usg])" composite="yes">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="current-grouping-key()">
|
||||||
|
<div class="abv-usg">
|
||||||
|
<xsl:apply-templates select="current-group()"/>
|
||||||
|
</div>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<!-- If there is no usg, create an empty div for correct
|
||||||
|
alignment -->
|
||||||
|
<xsl:if test="not(../tei:usg)">
|
||||||
|
<div class="abv-usg"></div>
|
||||||
|
</xsl:if>
|
||||||
|
<div class="abv-entrytxt">
|
||||||
|
<!-- Split main part into two paragraphs: examples and etym -->
|
||||||
|
<xsl:for-each-group select="current-group()"
|
||||||
|
group-adjacent="not(self::tei:etym)">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="current-grouping-key()">
|
||||||
|
<p class="abv-mainpart">
|
||||||
|
<xsl:apply-templates select="current-group()"/>
|
||||||
|
</p>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:apply-templates select="current-group()"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:for-each-group>
|
||||||
|
</div>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:for-each-group>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:for-each-group>
|
||||||
|
<!-- <div class="abv-usg">
|
||||||
|
<xsl:for-each select="tei:usg">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</div>
|
||||||
|
<div class="abv-entrytxt">
|
||||||
|
<p class="abv-mainpart">
|
||||||
|
<xsl:for-each select="*[not(self::tei:etym) and not(self::tei:form or self::tei:pc[following-sibling::*[1][self::tei:form]]) and not(self::tei:usg)]">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:for-each>
|
||||||
|
</p>
|
||||||
|
<xsl:apply-templates select="tei:etym"/>
|
||||||
|
</div> -->
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:form/tei:orth">
|
||||||
|
<xsl:variable name="elem">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="ancestor::tei:cit[@type='formGrp']">i</xsl:when>
|
||||||
|
<xsl:otherwise>b</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:variable>
|
||||||
|
<xsl:element name="{$elem}">
|
||||||
|
<xsl:attribute name="class">abv-form</xsl:attribute>
|
||||||
|
<xsl:attribute name="lang" select="../@xml:lang"/>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:cit[@type='translationEquivalent']/tei:quote | tei:gloss/tei:q">
|
||||||
|
<xsl:element name="q">
|
||||||
|
<xsl:attribute name="class">abv-gloss</xsl:attribute>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:cit[@type='translation']/tei:quote">
|
||||||
|
<xsl:element name="q">
|
||||||
|
<xsl:attribute name="class">abv-tr</xsl:attribute>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:cit[@type='example']/tei:quote">
|
||||||
|
<xsl:element name="i">
|
||||||
|
<xsl:attribute name="class">abv-example</xsl:attribute>
|
||||||
|
<xsl:attribute name="lang" select="../@xml:lang"/>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:ref[@type='bibl']">
|
||||||
|
<xsl:element name="a">
|
||||||
|
<xsl:attribute name="class">abv-bibl</xsl:attribute>
|
||||||
|
<xsl:attribute name="href" select="@target"/>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:ref[@type='bibl']/tei:abbr">
|
||||||
|
<xsl:element name="abbr">
|
||||||
|
<xsl:attribute name="class">abv-bibl</xsl:attribute>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:ref[@type='xr' and not(tei:c | tei:m | tei:w | tei:phr | tei:s)]">
|
||||||
|
<xsl:element name="a">
|
||||||
|
<xsl:attribute name="href" select="@target"/>
|
||||||
|
<xsl:element name="i">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="../@xml:lang">
|
||||||
|
<xsl:attribute name="lang" select="../@xml:lang"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:attribute name="lang">os</xsl:attribute>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:ref[@type='xr']/tei:c | tei:ref[@type='xr']/tei:m | tei:ref[@type='xr']/tei:w | tei:ref[@type='xr']/tei:phr | tei:ref[@type='xr']/tei:s">
|
||||||
|
<xsl:element name="a">
|
||||||
|
<xsl:attribute name="href" select="../@target"/>
|
||||||
|
<xsl:element name="i">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="@xml:lang">
|
||||||
|
<xsl:attribute name="lang" select="@xml:lang"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:attribute name="lang">os</xsl:attribute>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:name | tei:author">
|
||||||
|
<xsl:element name="span">
|
||||||
|
<xsl:attribute name="class">abv-name</xsl:attribute>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:lang">
|
||||||
|
<xsl:element name="abbr">
|
||||||
|
<xsl:attribute name="class">abv-lang</xsl:attribute>
|
||||||
|
<xsl:attribute name="data-lang" select="string-join(abv:getlangs(.),',')"/>
|
||||||
|
<!-- <xsl:attribute name="title">#</xsl:attribute> TODO: Implement lookup table for full language names -->
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template name="make-word">
|
||||||
|
<xsl:element name="i">
|
||||||
|
<!-- If the element has its own language, or is part of a
|
||||||
|
mentioned, assign it a language. Otherwise, assign a special tag
|
||||||
|
that says that it is not really a linguistic object (e.g. an
|
||||||
|
abstract hypothetical form, phonetic sequence, etc.)-->
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="../name() = 'mentioned' or @xml:lang">
|
||||||
|
<xsl:attribute name="lang" select="abv:getlangs(.)[1]"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:attribute name="lang" select="'zxx'"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:c | tei:m | tei:w | tei:phr | tei:s">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="../name() = 'mentioned'">
|
||||||
|
<xsl:element name="a">
|
||||||
|
<xsl:attribute name="href">#</xsl:attribute>
|
||||||
|
<xsl:call-template name="make-word"/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:call-template name="make-word"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- If pc is empty, add one space -->
|
||||||
|
<xsl:template match="tei:pc[not(node())]">
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ETYMOLOGY -->
|
||||||
|
<xsl:template match="tei:etym">
|
||||||
|
<p class="abv-etym">
|
||||||
|
<xsl:apply-templates />
|
||||||
|
</p>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:oRef">
|
||||||
|
<xsl:element name="i">
|
||||||
|
<!-- If oRef has a language, select it, otherwise
|
||||||
|
use the entry language -->
|
||||||
|
<xsl:attribute name="lang">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="@xml:lang">
|
||||||
|
<xsl:value-of select="@xml:lang"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="ancestor::tei:entry/@xml:lang"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:lb">
|
||||||
|
<xsl:element name="br"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:hi">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="@rendition='#rend_italic'">
|
||||||
|
<em><xsl:apply-templates/></em>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@rendition='#rend_bold'">
|
||||||
|
<strong><xsl:apply-templates/></strong>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@rendition='#rend_underline'">
|
||||||
|
<span class="abv-text-ul"><xsl:apply-templates/></span>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@rendition='#rend_subscript'">
|
||||||
|
<sub><xsl:apply-templates/></sub>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@rendition='#rend_superscript'">
|
||||||
|
<sup><xsl:apply-templates/></sup>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="@rendition='#rend_smallcaps'">
|
||||||
|
<span class="abv-text-sc"><xsl:apply-templates/></span>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- tables -->
|
||||||
|
<xsl:template match="tei:table">
|
||||||
|
<table>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</table>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:row">
|
||||||
|
<tr>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</tr>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:cell">
|
||||||
|
<td>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</td>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match=
|
||||||
|
"text()">
|
||||||
|
<xsl:value-of select="replace(translate(., '
', ''), ' +', ' ')"/>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
44
xsl/change-default-lang.xsl
Normal file
44
xsl/change-default-lang.xsl
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
||||||
|
xmlns:abv="http://ossetic-studies.org/ns/abaevdict"
|
||||||
|
exclude-result-prefixes="xs tei"
|
||||||
|
version="2.0">
|
||||||
|
<xsl:param name="default-lang"/>
|
||||||
|
|
||||||
|
<!-- XSLT Template to copy anything -->
|
||||||
|
<xsl:template match="@* | node()">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:gloss | tei:note">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:if test="not(@xml:lang)">
|
||||||
|
<xsl:attribute name="xml:lang">
|
||||||
|
<xsl:value-of select="$default-lang"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:lang[@xml:lang]">
|
||||||
|
<xsl:element name="tei:rs">
|
||||||
|
<xsl:attribute name="xml:lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>
|
||||||
|
<xsl:element name="tei:lang">
|
||||||
|
<xsl:attribute name="xml:lang">
|
||||||
|
<xsl:value-of select="$default-lang"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:value-of select="node() | @*[not(name()='xml:lang')]"/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match=
|
||||||
|
"text()">
|
||||||
|
<xsl:value-of select="replace(translate(., '
', ''), ' +', ' ')"/>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
30
xsl/delete-lang.xsl
Normal file
30
xsl/delete-lang.xsl
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
||||||
|
xmlns:abv="http://ossetic-studies.org/ns/abaevdict"
|
||||||
|
exclude-result-prefixes="xs tei"
|
||||||
|
version="2.0">
|
||||||
|
<xsl:param name="lang"/>
|
||||||
|
|
||||||
|
<!-- XSLT Template to copy anything -->
|
||||||
|
<xsl:template match="@* | node()">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:etym|abv:tr|tei:def|tei:note|tei:bibl|tei:gram">
|
||||||
|
<xsl:choose>
|
||||||
|
<!-- <xsl:when test="lang($lang)"></xsl:when>-->
|
||||||
|
<xsl:when test="@xml:lang = $lang"></xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:biblScope[@xml:lang=$lang]"></xsl:template>
|
||||||
|
</xsl:stylesheet>
|
33
xsl/insert-langs.xsl
Normal file
33
xsl/insert-langs.xsl
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
||||||
|
xmlns:abv="http://ossetic-studies.org/ns/abaevdict"
|
||||||
|
exclude-result-prefixes="xs tei"
|
||||||
|
version="3.0">
|
||||||
|
|
||||||
|
<xsl:param name="name-lang"/>
|
||||||
|
|
||||||
|
<xsl:mode on-no-match="shallow-copy" />
|
||||||
|
|
||||||
|
<xsl:import href="lang-names.xsl"/>
|
||||||
|
|
||||||
|
<xsl:template match="tei:lang[not(text())]">
|
||||||
|
<xsl:variable name="lang-code" select="ancestor-or-self::*[attribute::xml:lang][1]/@xml:lang"/>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:call-template name="lang-text">
|
||||||
|
<xsl:with-param name="lang-code" select="$lang-code"/>
|
||||||
|
<xsl:with-param name="name-lang" select="$name-lang"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:if test="parent::*/@extralang">
|
||||||
|
<xsl:for-each select="tokenize(parent::*/@extralang, ' ')">
|
||||||
|
<xsl:text>, </xsl:text>
|
||||||
|
<xsl:call-template name="lang-text">
|
||||||
|
<xsl:with-param name="lang-code" select="."/>
|
||||||
|
<xsl:with-param name="name-lang" select="$name-lang"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
79
xsl/insert-refs.xsl
Normal file
79
xsl/insert-refs.xsl
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
||||||
|
xmlns:abv="http://ossetic-studies.org/ns/abaevdict"
|
||||||
|
exclude-result-prefixes="xs tei"
|
||||||
|
version="2.0">
|
||||||
|
|
||||||
|
<xsl:param name="lookup-raw"/>
|
||||||
|
<xsl:param name="biblio-raw"/>
|
||||||
|
<xsl:param name="bib-lang"/>
|
||||||
|
|
||||||
|
<xsl:variable name="lookup" select="parse-xml($lookup-raw)"/>
|
||||||
|
<xsl:variable name="biblio" select="parse-xml($biblio-raw)"/>
|
||||||
|
|
||||||
|
<!-- <xsl:variable name="random-doc" select="document('entries/abaev_lami.xml')"/>-->
|
||||||
|
|
||||||
|
<xsl:key name="xr" match="table/entry" use="@xml:id"/>
|
||||||
|
|
||||||
|
<!-- XSLT Template to copy anything -->
|
||||||
|
<xsl:template match="@* | node()">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:ref[@type = 'xr'][not(node())]">
|
||||||
|
<xsl:variable name="target" select="@target"/>
|
||||||
|
<xsl:variable name="entry" select="$lookup/tei:table/tei:entry[@xml:id = substring($target, 2)]"/>
|
||||||
|
<xsl:if test="not($entry)"><xsl:message>Cross-referenced entry <xsl:value-of select="$target"/> not found! Lemma <xsl:value-of select="ancestor::tei:entry/@xml:id"/></xsl:message></xsl:if>
|
||||||
|
<!-- <xsl:message><xsl:value-of select="$lookup"/></xsl:message>-->
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
<xsl:if test="$entry/@n"><xsl:value-of xmlns:my="http://example.com/my" select="my:getN($entry/@n)"/></xsl:if><tei:w><xsl:value-of select="$entry/text()"/></tei:w>
|
||||||
|
</xsl:copy>
|
||||||
|
<!-- <xsl:message><xsl:value-of select="$random-doc/key('xr','entry_lami')"/></xsl:message>-->
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:ref[@type = 'bibl'][not(node())]">
|
||||||
|
<xsl:variable name="target" select="@target"/>
|
||||||
|
<xsl:variable name="bibl" select="$biblio/tei:TEI/tei:text/tei:body/tei:div//tei:listBibl/tei:bibl[@xml:id = substring($target, 2)]"/>
|
||||||
|
<xsl:if test="not($bibl)"><xsl:message>Cross-referenced bibitem <xsl:value-of select="$target"/> not found! Lemma <xsl:value-of select="ancestor::tei:entry/@xml:id"/></xsl:message></xsl:if>
|
||||||
|
<!-- <xsl:message><xsl:value-of select="$lookup"/></xsl:message>-->
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$bibl/tei:abbr[not(@xml:lang)]">
|
||||||
|
<xsl:copy-of select="$bibl/tei:abbr"/>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:copy-of select="$bibl/tei:abbr[@xml:lang = $bib-lang]"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:copy>
|
||||||
|
<!-- <xsl:message><xsl:value-of select="$random-doc/key('xr','entry_lami')"/></xsl:message>-->
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:oRef[not(node())]">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
<xsl:copy-of select="ancestor::*[local-name() = 'entry' or local-name() = 're'][position() = 1]/tei:form[1]/tei:orth[1]/child::node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:function xmlns:my="http://example.com/my" name="my:getN">
|
||||||
|
<xsl:param name="n"/>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$n = 1">¹</xsl:when>
|
||||||
|
<xsl:when test="$n = 2">²</xsl:when>
|
||||||
|
<xsl:when test="$n = 3">³</xsl:when>
|
||||||
|
<xsl:when test="$n = 4">⁴</xsl:when>
|
||||||
|
<xsl:when test="$n = 5">⁵</xsl:when>
|
||||||
|
<xsl:when test="$n = 6">⁶</xsl:when>
|
||||||
|
<xsl:when test="$n = 7">⁷</xsl:when>
|
||||||
|
<xsl:when test="$n = 8">⁸</xsl:when>
|
||||||
|
<xsl:when test="$n = 9">⁹</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:function>
|
||||||
|
</xsl:stylesheet>
|
2304
xsl/lang-names.xsl
Normal file
2304
xsl/lang-names.xsl
Normal file
File diff suppressed because it is too large
Load diff
354
xsl/standardize.xsl
Normal file
354
xsl/standardize.xsl
Normal file
|
@ -0,0 +1,354 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
||||||
|
xmlns:abv="http://ossetic-studies.org/ns/abaevdict"
|
||||||
|
exclude-result-prefixes="xs tei"
|
||||||
|
version="2.0">
|
||||||
|
|
||||||
|
<xsl:param name="standardize-lang"/>
|
||||||
|
|
||||||
|
<!-- NAMED TEMPLATES-->
|
||||||
|
|
||||||
|
<xsl:template name="defaultlang">
|
||||||
|
<xsl:if test="not(@xml:lang)">
|
||||||
|
<xsl:variable name="entrylang" select="ancestor::tei:entry/@xml:lang"/>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$entrylang = 'os'">
|
||||||
|
<xsl:attribute name="xml:lang">os-x-iron</xsl:attribute>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:attribute name="xml:lang" select="$entrylang"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- XSLT Template to copy anything -->
|
||||||
|
<xsl:template match="@* | node()">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Delete outdate elements-->
|
||||||
|
<xsl:template match="tei:encodingDesc|tei:tagsDecl">
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- The completeness attribute is to be used without namespace, to simplify styling.
|
||||||
|
For the purposes of conversion, delete it at present -->
|
||||||
|
|
||||||
|
<xsl:template match="@abv:completeness | @abv:status">
|
||||||
|
<!--<xsl:attribute name="completeness">
|
||||||
|
<xsl:value-of select="."/>
|
||||||
|
</xsl:attribute>-->
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Replace these guys with placeholders, will fix later -->
|
||||||
|
|
||||||
|
<xsl:template match="tei:publicationStatement">
|
||||||
|
<xsl:element name="tei:publicationStatement">
|
||||||
|
<tei:p>PLACEHOLDER</tei:p>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:sourceDesc">
|
||||||
|
<xsl:element name="tei:sourceDesc">
|
||||||
|
<tei:p>PLACEHOLDER</tei:p>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Replace custom elements with TEI elements -->
|
||||||
|
<xsl:template match="abv:tr">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:usg or self::tei:quote]">
|
||||||
|
<tei:pc><xsl:text> </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::abv:tr]">
|
||||||
|
<tei:pc><xsl:text>, </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:element name="tei:cit">
|
||||||
|
<xsl:attribute name="type">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="parent::tei:sense">translationEquivalent</xsl:when>
|
||||||
|
<xsl:when test="parent::abv:example">translation</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="abv:tr/tei:q">
|
||||||
|
<xsl:if test="preceding-sibling::*[1][self::tei:q]">
|
||||||
|
<tei:pc><xsl:text>, </xsl:text></tei:pc>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:element name="tei:quote">
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="abv:example">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="parent::abv:formGrp and preceding-sibling::*[1][self::tei:form]">
|
||||||
|
<tei:pc><xsl:text>: </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="parent::tei:sense">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::abv:tr]">
|
||||||
|
<tei:pc><xsl:text>: </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:sense]">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="(parent::tei:sense or parent::abv:exampleGrp) and preceding-sibling::*[1][self::abv:example]">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:element name="tei:cit">
|
||||||
|
<xsl:attribute name="type">example</xsl:attribute>
|
||||||
|
<xsl:call-template name="defaultlang"/>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="abv:exampleGrp">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="ancestor::tei:re[parent::tei:entry[child::tei:sense]]">
|
||||||
|
<tei:pc><xsl:text>: </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise><tei:pc>. — </tei:pc></xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
|
||||||
|
<xsl:element name="tei:dictScrap">
|
||||||
|
<xsl:apply-templates select="@*"/>
|
||||||
|
<xsl:if test="@n"><xsl:value-of select="@n"/><xsl:text>. </xsl:text></xsl:if>
|
||||||
|
<xsl:apply-templates select="node()"/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:re[tei:re]">
|
||||||
|
<xsl:element name="tei:dictScrap">
|
||||||
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- FORMS AND FORM GROUPS -->
|
||||||
|
|
||||||
|
<xsl:template match="abv:formGrp">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:sense or self::tei:re]">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:form] or (parent::tei:entry and preceding-sibling::*[1][self::abv:formGrp])">
|
||||||
|
<tei:pc><xsl:text>, </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::abv:exampleGrp]">
|
||||||
|
<tei:pc><xsl:text>. — </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:element name="tei:cit">
|
||||||
|
<xsl:attribute name="type">formGrp</xsl:attribute>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:element>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:form">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:usg]">
|
||||||
|
<tei:pc><xsl:text> </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:form[@xml:lang='os-x-iron']] and @xml:lang='os-x-digor'">
|
||||||
|
<tei:pc><xsl:text> | </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="(preceding-sibling::*[1][self::tei:orth] and (@type='variant' or @type='synonym')) or (preceding-sibling::*[1][self::tei:form] and parent::tei:form and @type = 'variant')">
|
||||||
|
<tei:pc><xsl:text>, </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:orth or self::tei:form[@type = 'variant']] and @type='participle'">
|
||||||
|
<tei:pc><xsl:text> : </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
|
||||||
|
<xsl:if test="@subtype='parens'"><xsl:text>(</xsl:text></xsl:if>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:if test="not(@xml:lang)">
|
||||||
|
<xsl:attribute name="xml:lang" select="ancestor::tei:entry/@xml:lang"/>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:apply-templates select="@*"/>
|
||||||
|
<xsl:if test="@type='rec'"><xsl:text>*</xsl:text></xsl:if>
|
||||||
|
<xsl:apply-templates select="node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
<xsl:if test="@subtype='parens'"><xsl:text>)</xsl:text></xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- WORDS ETC. -->
|
||||||
|
<xsl:template match="tei:w | tei:m | tei:c | tei:phr | tei:oRef">
|
||||||
|
<xsl:if test="preceding-sibling::*[1][@xml:lang='os-x-iron'] and @xml:lang='os-x-digor'"> <!-- THIS IS A HACK. MAYBE I'LL HAVE TO LIST THE TAG NAMES AFTER ALL -->
|
||||||
|
<tei:pc><xsl:text> | </xsl:text></tei:pc>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@*"/>
|
||||||
|
<xsl:if test="@type='rec'"><xsl:text>*</xsl:text></xsl:if>
|
||||||
|
<xsl:apply-templates select="node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- Orth after lang or gram -->
|
||||||
|
<xsl:template match="tei:form/tei:orth[preceding-sibling::*[1][self::tei:lang or self::tei:gram]]">
|
||||||
|
<tei:pc><xsl:text> </xsl:text></tei:pc>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- USAGE NOTES -->
|
||||||
|
<xsl:template match="tei:usg">
|
||||||
|
<xsl:variable name="is_afterForm"><xsl:value-of select="boolean(preceding-sibling::*[1][self::tei:form or self::abv:formGrp])"/></xsl:variable>
|
||||||
|
<xsl:if test="$is_afterForm">
|
||||||
|
<tei:pc><xsl:text> </xsl:text></tei:pc>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@*"/>
|
||||||
|
<xsl:if test="$is_afterForm">
|
||||||
|
<tei:pc><xsl:text>(</xsl:text></tei:pc>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:apply-templates select="node()"/>
|
||||||
|
<xsl:if test="$is_afterForm">
|
||||||
|
<tei:pc><xsl:text>)</xsl:text></tei:pc>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- SENSES -->
|
||||||
|
<xsl:template match="tei:sense">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::abv:formGrp or self::tei:re or self::tei:usg or self::tei:note]">
|
||||||
|
<tei:pc><xsl:text> </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="parent::tei:entry or parent::tei:re">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:sense]">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:form]">
|
||||||
|
<tei:pc><xsl:text> </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="parent::tei:sense and preceding-sibling::*[1][self::tei:sense]">
|
||||||
|
<tei:pc><xsl:text>, </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@*"/>
|
||||||
|
<xsl:if test="@n"><xsl:value-of select="@n"/>. </xsl:if>
|
||||||
|
<xsl:apply-templates select="node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- RELATED ENTRIES -->
|
||||||
|
<xsl:template match="tei:re">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::abv:formGrp]">
|
||||||
|
<tei:pc><xsl:text> </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="parent::tei:sense">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:re] or preceding-sibling::*[1][self::tei:sense] or (preceding-sibling::*[1][self::abv:tr] and child::*[1][self::tei:form])">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::abv:tr] and child::*[1][self::tei:form]">
|
||||||
|
<tei:pc><xsl:text>: </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="parent::*[abv:tr] and preceding-sibling::*[1][self::tei:note]">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="parent::tei:entry">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[self::tei:re and child::abv:exampleGrp]"><tei:pc><xsl:text>. — </xsl:text></tei:pc></xsl:when>
|
||||||
|
<xsl:when test="(preceding-sibling::*[1][self::tei:note] and child::*[1][self::tei:form]) or preceding-sibling::*[1][self::tei:sense or self::tei:re]"><tei:pc><xsl:text>; </xsl:text></tei:pc></xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="parent::tei:re">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:re and child::abv:exampleGrp]">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::tei:re]">
|
||||||
|
<tei:pc><xsl:text>, </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="preceding-sibling::*[1][self::abv:exampleGrp]">
|
||||||
|
<tei:pc><xsl:text>. — </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:call-template name="defaultlang"/>
|
||||||
|
<xsl:apply-templates select="@*"/>
|
||||||
|
<xsl:apply-templates select="node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- BIBLIO -->
|
||||||
|
<xsl:template match="abv:example/tei:bibl">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="preceding-sibling::*[self::tei:bibl]">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<tei:pc><xsl:text> (</xsl:text></tei:pc>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
<xsl:if test="last()">
|
||||||
|
<tei:pc><xsl:text>)</xsl:text></tei:pc>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- ENTRY AND ETYM PUNCTUATION -->
|
||||||
|
<xsl:template match="tei:entry[not(tei:etym)]">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy><tei:pc>.</tei:pc>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="tei:etym">
|
||||||
|
<tei:pc>.</tei:pc><tei:lb/><xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- QUOTE -->
|
||||||
|
<xsl:template match="tei:quote[preceding-sibling::*[1][self::tei:usg]]">
|
||||||
|
<tei:pc> </tei:pc><xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<!-- CROSSREF PUNCTUATION -->
|
||||||
|
<xsl:template match="tei:entry/tei:ref[@type='xr']">
|
||||||
|
<xsl:if test="preceding-sibling::*[1][self::tei:sense]">
|
||||||
|
<tei:pc><xsl:text>; </xsl:text></tei:pc>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@*"/>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$standardize-lang = 'en'">
|
||||||
|
<xsl:text>see </xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="$standardize-lang = 'ru'">
|
||||||
|
<xsl:text>см. </xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:apply-templates select="node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
17
xsl/strip-space.xsl
Normal file
17
xsl/strip-space.xsl
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
||||||
|
xmlns:abv="http://ossetic-studies.org/ns/abaevdict"
|
||||||
|
exclude-result-prefixes="xs tei"
|
||||||
|
version="2.0">
|
||||||
|
|
||||||
|
<xsl:strip-space elements="tei:entry abv:exampleGrp abv:example abv:tr tei:re tei:cit tei:sense"/>
|
||||||
|
|
||||||
|
<!-- XSLT Template to copy anything -->
|
||||||
|
<xsl:template match="@* | node()">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
Loading…
Add table
Add a link
Reference in a new issue