Browse Source

Utils: add rules to latex-preprocessing

remotes/origin/translate_notes
crep 15 years ago
parent
commit
bf6b3e8445
  1. 4
      songs/Alicia_Keys/If_aint_got_you.sg
  2. 4
      songs/Le_Donjon_de_Naheulbeuk/Noel_en_Mordor.sg
  3. 19
      utils/latex-preprocessing.py

4
songs/Alicia_Keys/If_aint_got_you.sg

@ -21,11 +21,11 @@
\endverse \endverse
\beginchorus \beginchorus
\[Sol7]Some \[Lam]peo\[Sim]ple \[Cmaj7]want it all, but \[Sol7]Some \[Lam]peo\[Sim]ple \[Do7]want it all, but
I don't \[Sim]want nothing at all. I don't \[Sim]want nothing at all.
If it ain't \[Lam]you baby; If it ain't \[Lam]you baby;
If I ain't got \[Sol7]you baby If I ain't got \[Sol7]you baby
\[Sol7]Some \[Lam]people \[Sim]want \[Cmaj7]diamond rings \[Sol7]Some \[Lam]people \[Sim]want \[Do7]diamond rings
Some just want \[Sim]everything, but everything means Some just want \[Sim]everything, but everything means
\[Lam]nothing, If I ain't got \[Sol7]you, yeah \[Lam]nothing, If I ain't got \[Sol7]you, yeah
\endchorus \endchorus

4
songs/Le_Donjon_de_Naheulbeuk/Noel_en_Mordor.sg

@ -14,14 +14,14 @@
Du Mor\[Lam]{dor à} la Com\[Do]té Du Mor\[Lam]{dor à} la Com\[Do]té
C'est \[Sol]Noël, c'est \[Mim]Noël C'est \[Sol]Noël, c'est \[Mim]Noël
Du Mor\[Lam]{dor à} la Com\[Do]té Du Mor\[Lam]{dor à} la Com\[Do]té
Tous les \[Sol]voeux sont \[Mim]exau\[Lam]cés Tous les \[Sol]vœux sont \[Mim]exau\[Lam]cés
\endchorus \endchorus
\beginverse \beginverse
\[Lam]Imagi\[Sol]nez que \[Fa]Père Noël le \[Mim]vieux \[Lam]Imagi\[Sol]nez que \[Fa]Père Noël le \[Mim]vieux
\[Lam]Souhaitant sou\[Sol]dain com\[Fa]pléter sa tour\[Mim]née \[Lam]Souhaitant sou\[Sol]dain com\[Fa]pléter sa tour\[Mim]née
\[Lam]{S'en} fut per\[Sol]du dans \[Fa]les Terres du Mi\[Mim]lieu \[Lam]{S'en} fut per\[Sol]du dans \[Fa]les Terres du Mi\[Mim]lieu
\[Lam]Les voeux de \[Sol]tous vou\[Fa]drait réali\[Mim]ser \[Lam]Les vœux de \[Sol]tous vou\[Fa]drait réali\[Mim]ser
\endverse \endverse
\beginverse \beginverse

19
utils/latex-preprocessing.py

@ -1,23 +1,36 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# warning: lines beginning with ## are parsed by
# the songbook-client as rules categories
import glob import glob
# the dictionary has target_word:replacement_word pairs # the dictionary has target_word:replacement_word pairs
word_dic = { word_dic = {
#oe inclusion ##: oe inclusion
"coeur": "cœur", "coeur": "cœur",
"boeuf": "bœuf", "boeuf": "bœuf",
"oeuvre": "œuvre", "oeuvre": "œuvre",
"soeur": "sœur", "soeur": "sœur",
"noeud": "nœud", "noeud": "nœud",
"oeil": "œil", "oeil": "œil",
"voeu": "vœu",
"oe{}": "œ", "oe{}": "œ",
#punctuation ##: Punctuation
"": "'", "": "'",
"Ca ": "Ça ", "Ca ": "Ça ",
"...": "\\dots ", "...": "\\dots ",
#Chords ##: Conversion from anglo-saxon conventions
"\\[A": "\\[La",
"\\[B": "\\[Si",
"\\[C": "\\[Do",
"\\[D]": "\\[Ré]",
"\\[E": "\\[Mi",
"\\[F]": "\\[Fa]",
"\\[G": "\\[Sol",
##: Guitar tabs
"\\[Re]": "\\[Ré]", "\\[Re]": "\\[Ré]",
"b]": "&]", "b]": "&]",
#Do #Do

Loading…
Cancel
Save