Skip to content

Commit

Permalink
Merge pull request #6 from petrparolek/bugfixes
Browse files Browse the repository at this point in the history
improved generating names of books in SQL
  • Loading branch information
petrparolek authored Jun 25, 2018
2 parents a6c996f + 5d40c43 commit 91993cb
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 78 deletions.
152 changes: 76 additions & 76 deletions bible-21-osis-to-epub/ObjektovyModel/Bible.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,88 +47,88 @@ public Bible()

private Dictionary<string, InformaceOKnize> NacistMapovaniZkratekKnih()
{
return new Dictionary<string, InformaceOKnize>
return new Dictionary<string, InformaceOKnize>
{
// Starý zákon.
{"Gen", "Gn;Genesis"},
{"Exod", "Ex;Exodus"},
{"Lev", "Lv;Leviticus"},
{"Num", "Nu;Numeri"},
{"Deut", "Dt;Deuteronomium"},
{"Josh", "Joz;Jozue"},
{"Judg", "Sd;Soudců"},
{"Ruth", "Rt;Rút"},
{"1Sam", "1S;1. Samuel"},
{"2Sam", "2S;2. Samuel"},
{"1Kgs", "1Kr;1. Královská"},
{"2Kgs", "2Kr;2. Královská"},
{"1Chr", "1Pa;1. Letopisů"},
{"2Chr", "2Pa;2. Letopisů"},
{"Ezra", "Ezd;Ezdráš"},
{"Neh", "Neh;Nehemiáš"},
{"Esth", "Est;Ester"},
{"Job", "Jb;Job"},
{"Ps", "Ž;Žalmy"},
{"Prov", "Př;Přísloví"},
{"Eccl", "Kaz;Kazatel"},
{"Song", "Pís;Píseň písní"},
{"Isa", "Iz;Izaiáš"},
{"Jer", "Jr;Jeremiáš"},
{"Lam", "Pl;Pláč"},
{"Ezek", "Ez;Ezechiel"},
{"Dan", "Dn;Daniel"},
{"Hos", "Oz;Ozeáš"},
{"Joel", "Jl;Joel"},
{"Amos", "Am;Amos"},
{"Obad", "Abd;Abdiáš"},
{"Jonah", "Jon;Jonáš"},
{"Nah", "Na;Nahum"},
{"Mic", "Mi;Micheáš"},
{"Hab", "Ab;Abakuk"},
{"Zeph", "Sf;Sofoniáš"},
{"Hag", "Ag;Ageus"},
{"Zech", "Za;Zachariáš"},
{"Mal", "Mal;Malachiáš"},
{"Gen", "Gn;Genesis;genesis"},
{"Exod", "Ex;Exodus;exodus"},
{"Lev", "Lv;Leviticus;leviticus"},
{"Num", "Nu;Numeri;numeri"},
{"Deut", "Dt;Deuteronomium;deuteronomium"},
{"Josh", "Joz;Jozue;jozue"},
{"Judg", "Sd;Soudců;soudcu"},
{"Ruth", "Rt;Rút;rut"},
{"1Sam", "1S;1. Samuel;1samuel"},
{"2Sam", "2S;2. Samuel;2samuel"},
{"1Kgs", "1Kr;1. Královská;1kralovska"},
{"2Kgs", "2Kr;2. Královská;2kralovska"},
{"1Chr", "1Pa;1. Letopisů;1letopisu"},
{"2Chr", "2Pa;2. Letopisů;2letopisu"},
{"Ezra", "Ezd;Ezdráš;ezdras"},
{"Neh", "Neh;Nehemiáš;nehemias"},
{"Esth", "Est;Ester;ester"},
{"Job", "Jb;Job;job"},
{"Ps", "Ž;Žalmy;zalmy"},
{"Prov", "Př;Přísloví;prislovi"},
{"Eccl", "Kaz;Kazatel;kazatel"},
{"Song", "Pís;Píseň písní;pisen"},
{"Isa", "Iz;Izaiáš;izaias"},
{"Jer", "Jr;Jeremiáš;jeremias"},
{"Lam", "Pl;Pláč;plac"},
{"Ezek", "Ez;Ezechiel;ezechiel"},
{"Dan", "Dn;Daniel;daniel"},
{"Hos", "Oz;Ozeáš;ozeas"},
{"Joel", "Jl;Joel;joel"},
{"Amos", "Am;Amos;amos"},
{"Obad", "Abd;Abdiáš;abdias"},
{"Jonah", "Jon;Jonáš;jonas"},
{"Nah", "Na;Nahum;nahum"},
{"Mic", "Mi;Micheáš;micheas"},
{"Hab", "Ab;Abakuk;abakuk"},
{"Zeph", "Sf;Sofoniáš;sofonias"},
{"Hag", "Ag;Ageus;ageus"},
{"Zech", "Za;Zachariáš;zacharias"},
{"Mal", "Mal;Malachiáš;malachias"},

// Deuterokanické knihy (ke Starému zákonu).
{"Tob", "Tob;Tobiáš"},
{"Bar", "Bar;Baruch"},
{"AddEsth", "Estp;Ester"},
{"AddDan", "Danp;Přídavky k Danielovi"},
{"Sir", "Sír;Sirachovec"},
{"Jdt", "Jud;Judita"},
{"Wis", "Mdr;Moudrost Šalomounova"},
{"1Macc", "1Mak;1. Makabejská"},
{"2Macc", "2Mak;2. Makabejská"},
{"Tob", "Tob;Tobiáš;tobias"},
{"Bar", "Bar;Baruch;baruch"},
{"AddEsth", "Estp;Ester;dtk_ester"},
{"AddDan", "Danp;Přídavky k Danielovi;pridavky_k_danielovi"},
{"Sir", "Sír;Sirachovec;sirachovec"},
{"Jdt", "Jud;Judita;judita"},
{"Wis", "Mdr;Moudrost Šalomounova;moudrost_salomounova"},
{"1Macc", "1Mak;1. Makabejská;1makabejska"},
{"2Macc", "2Mak;2. Makabejská;2makabejska"},

// Nový zákon.
{"Matt", "Mt;Matouš"},
{"Mark", "Mk;Marek"},
{"Luke", "L;Lukáš"},
{"John", "J;Jan"},
{"Acts", "Sk;Skutky"},
{"Rom", "Ř;Římanům"},
{"1Cor", "1Kor;1. Korintským"},
{"2Cor", "2Kor;2. Korintským"},
{"Gal", "Ga;Galatským"},
{"Eph", "Ef;Efeským"},
{"Phil", "Fp;Filipským"},
{"Col", "Ko;Koloským"},
{"1Thess", "1Te;1. Tesalonickým"},
{"2Thess", "2Te;2. Tesalonickým"},
{"1Tim", "1Tm;1. Timoteus"},
{"2Tim", "2Tm;2. Timoteus"},
{"Titus", "Tt;Titus"},
{"Phlm", "Fm;Filemon"},
{"Heb", "Žd;Židům"},
{"Jas", "Jk;Jakub"},
{"1Pet", "1Pt;1. Petr"},
{"2Pet", "2Pt;2. Petr"},
{"1John", "1J;1. Jan"},
{"2John", "2J;2. Jan"},
{"3John", "3J;3. Jan"},
{"Jude", "Ju;Juda"},
{"Rev", "Zj;Zjevení"}
{"Matt", "Mt;Matouš;matous"},
{"Mark", "Mk;Marek;marek"},
{"Luke", "L;Lukáš;lukas"},
{"John", "J;Jan;jan"},
{"Acts", "Sk;Skutky;skutky"},
{"Rom", "Ř;Římanům;rimanum"},
{"1Cor", "1Kor;1. Korintským;1korintskym"},
{"2Cor", "2Kor;2. Korintským;2korintskym"},
{"Gal", "Ga;Galatským;galatskym"},
{"Eph", "Ef;Efeským;efeskym"},
{"Phil", "Fp;Filipským;filipskym"},
{"Col", "Ko;Koloským;koloskym"},
{"1Thess", "1Te;1. Tesalonickým;1tesalonickym"},
{"2Thess", "2Te;2. Tesalonickým;2tesalonickym"},
{"1Tim", "1Tm;1. Timoteus;1timoteovi"},
{"2Tim", "2Tm;2. Timoteus;2timoteovi"},
{"Titus", "Tt;Titus;titus"},
{"Phlm", "Fm;Filemon;filemon"},
{"Heb", "Žd;Židům;zidum"},
{"Jas", "Jk;Jakub;jakub"},
{"1Pet", "1Pt;1. Petr;1petr"},
{"2Pet", "2Pt;2. Petr;2petr"},
{"1John", "1J;1. Jan;1jan"},
{"2John", "2J;2. Jan;2jan"},
{"3John", "3J;3. Jan;3jan"},
{"Jude", "Ju;Juda;juda"},
{"Rev", "Zj;Zjevení;zjeveni"}
};
}

Expand Down
7 changes: 5 additions & 2 deletions bible-21-osis-to-epub/SqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,17 @@ public string VygenerovatSql(Bible bible)
Nadpisy.Clear();
Verse.Clear();

string nadpis = bible.MapovaniZkratekKnih[kniha.Id].Nadpis;
string[] nadpisPale = nadpis.Split(';');

StavecKnihy.Append("INSERT INTO bible_knihy (id, kod, nazev, `order`) VALUES " +
$"({poradi + 1}, '{kniha.Id}', '{bible.MapovaniZkratekKnih[kniha.Id].Nadpis}', {poradi + 1});\n");
$"({poradi + 1}, '{nadpisPale[1]}', '{nadpisPale[0]}', {poradi + 1});\n");

VygenerovatSqlProKnihu(bible, kniha);

StavecNadpisy.Append(string.Join(string.Empty, Nadpisy));
StavecNadpisy.AppendLine();

StavecVerse.Append("INSERT INTO bible_verse (kniha_id, kapitola, vers, text, stripped, `order`) VALUES \n");
StavecVerse.Append(string.Join(",\n", Verse));
StavecVerse.Append(";");
Expand Down

0 comments on commit 91993cb

Please sign in to comment.