From d39d3add77c9642fa3e2a8546ba2a8769e0e3dd4 Mon Sep 17 00:00:00 2001 From: Camden Date: Tue, 12 Nov 2024 15:07:03 -0500 Subject: [PATCH] update TEI formatting for text parser (#39) --- data/images-example.xml | 596 ++++++++++++++++++++-------------------- src/text.js | 9 +- 2 files changed, 303 insertions(+), 302 deletions(-) diff --git a/data/images-example.xml b/data/images-example.xml index 45c274e..6e98ed1 100644 --- a/data/images-example.xml +++ b/data/images-example.xml @@ -53,78 +53,78 @@ - +
-
+ -
-
+ + [List of names] -
-
+ + Mestre Nico[illegible] Costé, in the Rue de la Heaumerie, at the sign of St Claude / Mirrors. -
-
+ + Mestre Jehan Cousin, who resides in the Faubourg Saint-Germain, knows of the master. -
-
+ + Mestre Jehan Garnier, in the Rue des Escrivains by St Jacques de la Boucherie, currier. Try pastel woad flowers. -
-
+ + [List] -
-
+ + The harvester that leaves some ears is not blamed. -
-
+ + Sacra Eleusinæ deæ propalare nefas. -
-
+ + Trumpets, see the book of funerals. -
-
+ + [List of books and authors] -
-
+ + Vuolfangus Lazius -
-
+ + Petrus Appianus, mathematicus Ingolstadiensis, Comment. urb. rom. -
-
+ + Hieronimo Ruscelli -
-
+ + Hermolaus Barbarus -
-
+ + Angelius Bargæus, De aucupio et venatione -
-
+ + Nicolaus Damascenus -
-
+ + Caresariensis, De rebus Persarum -
-
+ + Isidorus -
-
+ + Osorius -
-
+ + Eupolemus, historicus gentilis qui de rebus Davidis & Salomonis scripsit @@ -134,264 +134,264 @@                       mons{ieur} -
-
+ + - Cathalogue des villes -
-
+ + Calendrier des bergiers -
-
+ + Grammaire italiene -
-
+ + Arithmetique of Savonne -
-
+ + Instruction pour le faict des finances -
-
+ + Questions aeigmatiques -
-
+ + Des præceptes d’agriculture -
-
+ + + Le secret des finances à Lyon -
-
+ + Synesius -
-
+ + Olaus Magnus -
-
+ + + Mestre Bernard Palissi, inventor of rustic figulines to the -
-
+ + king and the queen mother -
-
+ + Alexander Aphrodisæus -
-
+ + Polydorus Vergilius -
-
+ + Appianus -
-
+ + Athenæus -
-
+ + Pausanias -
-
+ + Statius Thebaidos -
-
+ + Servius, in Aeneidem -
-
+ + Macrobius -
-
+ + Aulus Gellius -
-
+ + Alexander ab Alexandria -
-
+ + Festus -
-
+ + Nonius -
-
+ + Magius, Miscellanea -
-
+ + Pollux, Onomasticon -
-
+ + Higinus -
-
+ + Berosus -
-
+ + Suetonius -
-
+ + Valerius Maximus -
-
+ + Cornelius Tacitus -
-
+ + Xenophon -
-
+ + Seneca -
-
+ + Dionisius Halicarnassensis -
-
+ + Sabellicus -
-
+ + cum permultis -
-
+ + aliis Julius Capitolinus -
-
+ + Budæus -
-
+ + Spartianus -
-
+ + Blondus -
-
+ + Volaterranus -
-
+ + Herodotus -
-
+ + Paulus Manutius -
-
+ + Strabo -
-
+ + Julius Firmicus -
-
+ + Quintus Curtius -
-
+ + Dion -
-
+ + Cornelius Nepos -
-
+ + Flavius Vopiscus -
-
+ + -
-
+ + [List of books] -
-
+ + Aquatilium animalium historiæ, Hypolito Salviano Typhernate authore, Romæ 1554 -
-
+ + -
-
+ + Les Annales de Normandie -
-
+ + -
+ -
+ -
-
+ + For loosening the belly -
-
+ + Prunes of Saint Antonin, &, if you like, you want put among them leaves of mallow & gilliflower, adding in sugar &, if one wants, a little cinnamon for the stomach. -
-
+ + Or else, marshmallow root in a chicken broth. The fresh kind is more mollifying. -
-
+ + Beating syrup of sweet jujubes with water & taking it in the morning loosens the belly. -
-
+ + -
+ -
+ -
-
+ + Books to recover -
-
+ + The chronicles of Sigebert -
-
+ + Ruffinus -
-
+ + Ireniusin Exegesi -
-
+ + Paule Emile -
-
+ + Paule Jove -
-
+ + Polydorus -
-
+ + Bergomensis -
-
+ + Philippe de Commines -
-
+ + Against pains -
-
+ + Turpentine oil, oil of Jacob, and salt extracted from cabbage ash. -
-
+ + -
+ -
+ -
-
+ + [List of books] Practica, cioè nova inventione di contegiare, stampata in Brescia per Vincenzo Sabio. -
-
+ + Emeralds of Brissac -
-
+ + I have taken minium 26 ℥, crystal [illegible] and ground on marble 12 ℥, verdet 3 @@ -399,43 +399,43 @@ crucible covered with another, well luted, that has a hole in the top. Fusion 7 hours without blowing. The mass was of a beautiful green. -
-
+ + I have taken minium 12 ℥, crystal 6 ℥, verdet 2 grains. Soft fusion vi hours, refired 24 hours. The mass was green, yellow & red. -
-
+ + | Sapphire -
-
+ + Pebbles or crystal 8 ℥, minium 16 ℥, blacksmith’s salt 4 ℥, sparkling coryal 4 grains. Fusion 6 hours. -
-
+ + -
+ -
+ -
-
+ + Counterfeit coral -
-
+ +                       + -
-
+ + One needs to first make the branches of wood or take a bizarre thorn branch, then melt a lb of the most beautiful clear pitch resin and put in one ounce of @@ -446,8 +446,8 @@ Next dip in your branches while turning, & if any filaments should remain on it, turn the branch over the heat of the charcoal. -
-
+ + Colophony is nothing other than recooked resin. To do it well, take a leaded pot & melt the resin, & boil it over the brazier a good hour, @@ -463,25 +463,25 @@ mastic into your purified resin to render it more firm and more beautiful, & if you were to take a single tear of mastic, it would be all the better, but it would be too long. -
-
+ + Sulfur & vermilion makes the same effect. -
-
+ + The coral made of gules red enamel endures the file and polishing. -
-
+ + It is made like cement that is stronger mixed with pestled <-than of-> glass rather than with brick. Thus, here one mixes well pestled gules red enamel, which is red in body, with the vermilion. Thus with all colors of enamels. -
-
+ + Varnish for panels -
-
+ + Take a lb of Venice turpentine & heat it in a pot until it simmers, and put in half a lb of the turpentine oil of the whitest you can find, and stir it @@ -496,19 +496,19 @@ overnight, and during the winter as well as in the summer. It is commonly sold 15 sous a lb. -
-
+ + A little more turpentine than turpentine oil is needed in order to give body to the varnish, which needs to be applied with the finger in order to spread it thinner and less thick, for when it is thick, it turns yellow and sticks. One does not varnish to make paintings shine, for it just takes the light out of them. -
-
+ + Thick varnish for planks -
-
+ + There is a varnish that takes a long time to dry & drips more than two months after it has been applied to the planks. But this one does not drip like that of times @@ -517,32 +517,32 @@ & with wheat. And this one yellowed & rendered greenish the blue color of paintings. This one is made like the other one except that one puts coarse common turpentine -
-
+ + But it is used to heighten colors which have soaked in and to keep them from dust. Mastic varnish does not resist rain, whereas that of oil and rosin does. -
-
+ + -
+ -
+ -
-
+ + instead of fine turpentine. And you can put into two lb of <-tou-> common turpentine one lb of fine turpentine oil & do everything as with the other one. This one will cost you no more than five or six sous per lb & is sold for 40 sous per lb. -
-
+ + This vessel is for making large quantities of turpentine oil, that is to say a bucket an hour, and no matter which turpentine it may be, @@ -555,21 +555,21 @@ do not need a oven for this copper vessel, but only charcoal around it if it has a flat bottom, but if it is round, you will place it on a trivet. -
-
+ + It is better to heat the varnish a little bit, rather than to put it out in the sun, because this makes the panel warp. -
-
+ + Some say it is not good to distil in this copper vessel because it makes things green. However, when tinned, it is good. -
-
+ + For varnishing -
-
+ + Turpentine varnish does not need any glue because it is fatty & viscous & it is not absorbed in the wood like that of spike lavender & sandarac. Also, that of spike @@ -579,19 +579,19 @@ distemper glue, it is necessary to lay one coat of the said hide glue & to let it dry & to varnish. -
-
+ + -
+ -
+ -
-
+ + Varnish of spike lavender oil -
-
+ + One needs to heat spike lavender oil & as it begins to simmer, put in powdered sandarac gum so that it soon melts. And over a charcoal fire stir continuously until the sandarac @@ -610,24 +610,24 @@ turpentine, one varnishes everywhere. You can put in pulverized mastic extracted in tears or otherwise, & it will be more desiccative, in place of sandarac. -
-
+ + If you want to varnish on plaster or a wall, first put on your very hot hide glue, because if were cold it would not penetrate the wall, & when you would put your varnish on, it would come off. -
-
+ + Varnish of spike lavender oil is not as appropriate for colors as that of turpentine, for spike lavender oil <-makes them die-> eats the colors since it is too penetrating. -
-
+ + For removing varnish from an old panel that is yellowish & varnishing it anew -
-
+ + Take white soap & sieved ashes<-e->, & soak both in water. And with a sponge, take the said ashes & soap & rub the panel with them. And as you @@ -636,23 +636,23 @@ Next put it for a quarter of an hour in the sun to make it dry and to revive the colors. Next, once the panel is dry, you can spread your turpentine varnish on it. -
-
+ + Make sure the colors do not come off. -
-
+ + -
+ -
+ -
-
+ + Black varnish for sword guard, bands for trunks, &c -
-
+ + Take linseed oil or more cheaply, walnut oil, and rid it of grease with garlic & <-onions-> +hog’s @@ -668,50 +668,50 @@ varnish with a feather or a brush. And when you see that it no longer smokes, it is done and your varnish is dry. -
-
+ + For excellent black varnish, add two or three paternoster beads of jet among the rest. -
-
+ + Some consider walnut oil better. -
-
+ + If there is a lot of varnish, it needs to boil for at least half a day, for it is better the more it boils. It is dangerous if it catches fire, if it goes over the top, and is hard to extinguish. Make this therefore in a courtyard or an open space. -
-
+ + -
-
+ + In five or six lb of oil, one must put one lb of galipot, which costs 4 sous, & some peeled garlic cloves. This varnish in and of itself is not black, but it blackens over the fire. -
-
+ + See below, around the 3rd part of this book, after sands, in the chapter on furbishers. -
-
+ + Black varnish without fire, without disassembling the harnesses or removing the bands from trunks -
-
+ + Take varnish of spike lavender oil & mix in soot black or lampblack, & without fire it will mix in by itself. Varnish with a brush & it will soon be dry. Turpentine varnish will be quite good, but it does not dry as soon. -
-
+ + Varnish of iron engravers -
-
+ + Take linseed oil or walnut oil &, in place of black pitch, you will put in a little pitch resin, & it needs to be cooked in the fashion of black @@ -723,11 +723,11 @@ strong vinegar & leave it for xx4 hours before using it, & all will be tempered. Next spread some of this liquor or sauce on the engraved object with a sponge -
-
+ + -
+ - +
\ No newline at end of file diff --git a/src/text.js b/src/text.js index 7ab3641..2e753ad 100644 --- a/src/text.js +++ b/src/text.js @@ -13,9 +13,9 @@ function processTextFiles(dirPath) { xmls.push(processFile(`${path.join(dirPath, filename)}`, fileId)) } - return ` + return `
${xmls.join('\n')} - ` +
` } function sanitize(str) { @@ -30,16 +30,17 @@ function sanitize(str) { function processFile(filename, id) { const contents = fs.readFileSync(filename).toString() const splitContents = contents.split(/\n{2,}/) + let xmlStr = `\n` splitContents.forEach((section) => { - let sectionStr = `
\n` + let sectionStr = `\n` section.split('\n').forEach((str) => { sectionStr += `${sanitize(str)}\n` }) - sectionStr += '
\n' + sectionStr += '\n' xmlStr += sectionStr })