Skip to content

Instantly share code, notes, and snippets.

@grutz
Created August 21, 2012 18:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grutz/3418329 to your computer and use it in GitHub Desktop.
Save grutz/3418329 to your computer and use it in GitHub Desktop.
Generate Religious Book/Chapter/Verse combinations
#!/usr/bin/env python
"""
Bible/Quran books, chapters, and verse wordlist generator
This script creates an output of books of the Bible and Quran, permutations of their
chapters and verses. Includes common abbreviations of book names and the Spanish equivalent
for the Bible.
(c) 2012 Kurt Grutzmacher <grutz@jingojango.net>
Code released to the public domain
"""
import sys
__version__ = '1.0'
__author__ = 'Kurt Gruztmacher - <grutz@jingojango.net>'
#----------------------------------------------------------------------
def version():
vertext = """Bible/Quran Book, Chapter and Verse Wordlist Generator
(c) 2012 by %s
Released to the public domain
Version %s
""" % (__author__, __version__)
sys.stdout.write(vertext)
return
#----------------------------------------------------------------------
def output(options):
"""
Output the generated string to stdout or file
"""
pass
#----------------------------------------------------------------------
def generate_bible():
bible_books = [
# [ [ 'book', 'names' ], chap_count, [chap1_verses, chap2_verses, chap3_verses, ... ] ],
# Old Testament
[ ['Genesis', 'Gen', 'Ge', 'Gn'], 50, [31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26] ],
[ ['Exodus', 'Exo', 'Ex', 'Exod', 'Exodo'], 40, [22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,26,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38] ],
[ ['Leviticus', 'Lev', 'Le', 'Lv', 'Levitico'], 27, [17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34] ],
[ ['Numbers', 'Num', 'Nu', 'Nm', 'Nb', 'Numeros'], 36, [1289,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13] ],
[ ['Deuteronomy', 'Deut', 'Dt', 'Deuteronomio'], 34, [959,46,37,29,49,33,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12] ],
[ ['Joshua', 'Josh', 'Jos', 'Jsh', 'Josue'], 24, [658,18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33] ],
[ ['Judges', 'Judg', 'Jdg', 'Jg', 'Jdgs', 'Jueces'], 21, [618,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25] ],
[ ['Ruth', 'Rth', 'Ru', 'Rut'], 4, [85,22,23,18,22] ],
[ ['1 Samuel', '1 Sam', '1 Sa', '1Samuel', '1S', 'I Sa', '1 Sm', '1Sa', 'I Sam', '1Sam', 'I Samuel', '1st Samuel', 'First Samuel'], 31, [810,28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,28,23,43,25,12,25,11,31,13] ],
[ ['2 Samuel', '2 Sam', '2 Sa', '2S', 'II Sa', '2 Sm', '2Sa', 'II Sam', '2Sam', 'II Samuel', '2Samuel', '2nd Samuel', 'Second Samuel'], 24, [695,27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25] ],
[ ['1 Kings', '1 Reyes', '1 Kgs', '1 Ki', '1K', 'I Kgs', '1Kgs', 'I Ki', '1Ki', 'I Kings', '1Kings', '1st Kgs', '1st Kings', 'First Kings', 'First Kgs', '1Kin'], 22, [817,53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54] ],
[ ['2 Kings', '2 Reyes', '2 Kgs', '2 Ki', '2K', 'II Kgs', '2Kgs', 'II Ki', '2Ki', 'II Kings', '2Kings', '2nd Kgs', '2nd Kings', 'Second Kings', 'Second Kgs', '2Kin'], 25, [719,18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30] ],
[ ['1 Chronicles', '1 Cronicas', '1 Chron', '1 Ch', 'I Ch', '1Ch', '1 Chr', 'I Chr', '1Chr', 'I Chron', '1Chron', 'I Chronicles', '1Chronicles', '1st Chronicles', 'First Chronicles'], 29, [943,54,55,24,43,41,66,40,40,44,14,47,41,14,17,29,43,27,17,19,8,30,19,32,31,31,32,34,21,30] ],
[ ['2 Chronicles', '2 Cronicas', '2 Chron', '2 Ch', 'II Ch', '2Ch', 'II Chr', '2Chr', 'II Chron', '2Chron', 'II Chronicles', '2Chronicles', '2nd Chronicles', 'Second Chronicles'], 36, [821,18,17,17,22,14,42,22,18,31,19,23,16,23,14,19,14,19,34,11,37,20,12,21,27,28,23,9,27,36,27,21,33,25,33,26,23] ],
[ ['Ezra', 'Ezr', 'Esdras'], 10, [280,11,70,13,24,17,22,28,36,15,44] ],
[ ['Nehemiah', 'Neh', 'Ne', 'Nehemias'], 13, [405,11,20,38,17,19,19,72,18,37,40,36,47,31] ],
[ ['Tobit', ' Tob', 'Tb'], 14, [245,22,14,17,21,22,18,17,21,6,14,18,22,18,15] ],
[ ['Judith', 'Jdth', 'Jdt', 'Jth'], 16, [340,16,28,10,15,24,21,32,36,14,23,23,20,20,19,14,25] ],
[ ['Esther', 'Esth', 'Es', 'Ester'], 16, [272,22,23,15,17,14,14,10,17,32,3,17,8,30,16,24,10] ],
[ ['1 Maccabees', '1 Macc', '1 Mac', '1M', 'I Ma', '1Ma', 'I Mac', '1Mac', 'I Macc', '1Macc', 'I Maccabees', '1Maccabees', '1st Maccabees', 'First Maccabees'], 16, [922,63,70,59,61,68,63,50,32,73,89,74,53,53,49,41,24] ],
[ ['2 Maccabees', '2 Macc', '2 Mac', '2M', 'II Ma', '2Ma', 'II Mac', '2Mac', 'II Macc', '2Macc', 'II Maccabees', '2Maccabees', '2nd Maccabees', 'Second Maccabees'], 15, [556,36,32,40,50,27,31,42,36,29,38,38,46,26,46,39] ],
[ ['Job', 'Jb'], 42, [1068,22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,22,16,21,29,29,34,30,17,25,6,14,21,28,25,31,40,22,33,37,16,33,24,41,30,32,26,17] ],
[ ['Psalms', 'Pslm', 'Ps', 'Psalms', 'Psa', 'Psm', 'Pss', 'Salmos'], 150, [6,11,9,9,13,11,18,10,21,18,7,9,6,7,5,11,15,51,15,10,14,32,6,10,22,11,14,9,11,13,25,11,22,23,28,13,40,23,14,18,14,12,5,27,18,12,10,15,21,23,
21,11,7,9,24,14,12,12,18,14,9,13,12,11,14,20,8,36,37,6,24,20,28,23,11,13,21,72,13,20,17,8,19,13,14,17,7,19,53,17,16,16,5,23,11,13,12,9,9,5,
150,2526,8,29,22,35,45,48,43,14,31,7,10,10,9,8,18,19,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,14,10,8,12,15,21,10,20,14,9,6] ],
[ ['Proverbs', 'Proverb', 'Proverbios'], 31, [915,33,22,35,27,23,35,27,36,18,32,31,28,25,35,33,33,28,24,29,30,31,29,35,34,28,28,27,28,27,33,31] ],
[ ['Ecclesiastes', 'Eccles', 'Ec', 'Qoh', 'Qoheleth', 'Eclesiastes'], 12, [222,18,26,22,17,19,12,29,17,18,20,10,14] ],
[ ['Song of Solomon', 'Song', 'So', 'Canticle of Canticles', 'Canticles', 'Song of Songs', 'SOS', 'Psalms of Solomon', 'Ps Solomon', 'Ps Sol', 'Psalms Solomon', 'PsSol', 'Cantares'], 8, [117,17,17,11,16,16,12,14,14] ],
[ ['Wisdom of Solomon', 'Wisd of Sol', 'Wis', 'Ws', 'Wisdom'], 19, [436,16,24,19,20,23,25,30,21,18,21,26,27,19,31,19,29,21,25,22] ],
[ ['Sirach', 'Sir', 'Ecclesiasticus', 'Ecclus'], 51, [1372,29,18,30,31,17,37,36,19,18,30,34,18,25,27,20,28,27,33,26,30,28,27,27,31,25,20,30,26,28,25,31,24,33,26,24,27,30,34,35,30,24,25,35,23,26,20,25,25,16,29,30] ],
[ ['Isaiah', 'Isa', 'Is', 'Isaias'], 66, [1291,31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24] ],
[ ['Jeremiah', 'Jer', 'Je', 'Jr', 'Jeremias'], 52, [1364,19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34] ],
[ ['Lamentations', 'Lam', 'La', 'Lamentaciones'], 5, [154,22,22,66,22,22] ],
[ ['Baruch', 'Bar'], 6, [213,22,35,38,37,9,72] ],
[ ['Ezekiel', 'Ezek', 'Eze', 'Ezk', 'Ezequiel'], 48, [1271,28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35] ],
[ ['Daniel', 'Dan', 'Da', 'Dn'], 14, [530,21,49,100,34,30,29,28,27,27,21,45,13,64,42] ],
[ ['Hosea', 'Hos', 'Ho', 'Oseas'], 14, [197,9,25,5,19,15,11,16,14,17,15,11,15,15,10] ],
[ ['Joel', 'Joe', 'Jl'], 4, [73,20,27,5,21] ],
[ ['Amos', 'Am'], 9, [146,15,16,15,13,27,14,17,14,15] ],
[ ['Obadiah', 'Obad', 'Ob', 'Abdias'], 1, [21,21] ],
[ ['Jonah', 'Jnh', 'Jon', 'Jonas'], 4, [48,16,11,10,11] ],
[ ['Micah', 'Mic', 'Miqueas'], 7, [105,16,13,12,14,14,16,20] ],
[ ['Nahum', 'Nah', 'Na'], 3, [47,14,14,19] ],
[ ['Habakkuk', 'Hab', 'Habacuc'], 3, [56,17,20,19] ],
[ ['Zephaniah', 'Zeph', 'Zep', 'Zp', 'Sofanias'], 3, [53,18,15,20] ],
[ ['Haggai', 'Hag', 'Hg', 'Hageo'], 2, [38,15,23] ],
[ ['Zechariah', 'Zech', 'Zec', 'Zc', 'Zacarias'], 14, [211,17,17,10,14,11,15,14,23,17,12,17,14,9,21] ],
[ ['Malachi', 'Mal', 'Ml', 'Malaquias'], 3, [55,14,17,24] ],
# New Testament
[ ['Matthew', 'Matt', 'Mt', 'Mateo'], 28, [25,23,17,25,48,34,29,34,38,42,30,50,58,36,39,28,27,35,30,34,46,46,39,51,46,75,66,20] ],
[ ['Mark', 'Mrk', 'Mk', 'Mr', 'Marcos'], 16, [45,28,35,41,43,56,37,38,50,52,33,44,37,72,47,20] ],
[ ['Luke', 'Luk', 'Lk', 'Lucas'], 24, [80,52,38,44,39,49,50,56,62,42,54,59,35,35,32,31,37,43,48,47,38,71,56,53] ],
[ ['John', 'Jn', 'Jhn', 'Juan'], 21, [51,25,36,54,47,71,53,59,41,42,57,50,38,31,27,33,26,40,42,31,25] ],
[ ['Acts', 'Ac', 'Hechos'], 28, [26,47,26,37,42,15,60,40,43,48,30,25,52,28,41,40,34,28,40,38,40,30,35,27,27,32,44,31] ],
[ ['Romans', 'Rom', 'Ro', 'Rm', 'Romanos'], 16, [32,29,31,25,21,23,25,39,33,21,36,21,14,23,33,27] ],
[ ['1 Corinthians', '1 Corintios', '1 Cor', '1 Co', 'I Co', '1Co', 'I Cor', '1Cor', 'I Corinthians', '1Corinthians', '1st Corinthians', 'First Corinthians'], 16, [31,16,23,21,13,20,40,13,27,33,34,31,13,40,58,24] ],
[ ['2 Corrinthians', '2 Corintios', '2 Cor', '2 Co', 'II Co', '2Co', 'II Cor', '2Cor', 'II Corinthians', '2Corinthians', '2nd Corinthians', 'Second Corinthians'], 13, [24,17,18,18,21,18,16,24,15,18,33,21,13] ],
[ ['Galatians', 'Gal', 'Ga', 'Galatas'], 6, [24,21,29,31,26,18] ],
[ ['Ephesians', 'Ephes', 'Eph', 'Efesios'], 6, [23,22,21,32,33,24] ],
[ ['Philippians', 'Phil', 'Php', 'Fillipenses'], 4, [30,30,21,23] ],
[ ['Colossians', 'Col', 'Colosenses'], 4, [29,23,25,18] ],
[ ['1 Thessalonians', '1 Tesalonicenses', '1 Thess', '1 Th', 'I Th', '1Th', 'I Thes', '1Thes', 'I Thess', '1Thess', 'I Thessalonians', '1Thessalonians', '1st Thessalonians', 'First Thessalonians'], 5, [10,20,13,18,28] ],
[ ['2 Thessalonians', '2 Tesalonicenses', '2 Thess', '2 Th', 'II Th', '2Th', 'II Thes', '2Thes', 'II Thess', '2Thess', 'II Thessalonians', '2Thessalonians', '2nd Thessalonians', 'Second Thessalonians'], 3, [12,17,18] ],
[ ['1 Timothy', '1 Timoteo', '1 Tim', '1 Ti', 'I Ti', '1Ti', 'I Tim', '1Tim', 'I Timothy', '1Timothy', '1st Timothy', 'First Timothy'], 6, [20,15,16,16,25,21] ],
[ ['2 Timothy', '2 Timoteo', '2 Tim', '2 Ti', 'II Ti', '2Ti', 'II Tim', '2Tim', 'II Timothy', '2Timothy', '2nd Timothy', 'Second Timothy'], 4, [18,26,17,22] ],
[ ['Titus', 'Tit', 'Tito'], 3, [16,15,15] ],
[ ['Philemon', 'Philem', 'Phm', 'Filemon'], 1, [25] ],
[ ['Hebrews', 'Heb', 'Hebreos'], 13, [14,18,19,16,14,20,28,13,28,39,40,29,25] ],
[ ['James', 'Jas', 'Jm', 'Santiago'], 5, [27,26,18,17,20] ],
[ ['1 Peter', '1 Pedro', '1 Pet', '1 Pe', 'I Pe', '1Pe', 'I Pet', '1Pet', 'I Pt', '1 Pt', '1Pt', 'I Peter', '1Peter', '1st Peter', 'First Peter'], 5, [25,25,22,19,14] ],
[ ['2 Peter', '2 Pedro', '2 Pet', '2 Pe', 'II Pe', '2Pe', 'II Pet', '2Pet', 'II Pt', '2 Pt', '2Pt', 'II Peter', '2Peter', '2nd Peter', 'Second Peter'], 3, [21,22,18] ],
[ ['1 John', '1 Juan', '1 Jn', 'I Jn', '1Jn', 'I Jo', '1Jo', 'I Joh', '1Joh', 'I Jhn', '1 Jhn', '1Jhn', 'I John', '1John', '1st John', 'First John'], 5, [10,29,24,21,21] ],
[ ['2 John', '2 Juan', '2 Jn', 'II Jn', '2Jn', 'II Jo', '2Jo', 'II Joh', '2Joh', 'II Jhn', '2 Jhn', '2Jhn', 'II John', '2John', '2nd John', 'Second John'], 1, [13] ],
[ ['3 John', '3 Juan', '3 Jn', 'III Jn', '3Jn', 'III Jo', '3Jo', 'III Joh', '3Joh', 'III Jhn', '3 Jhn', '3Jhn', 'III John', '3John', '3rd John', 'Third John'], 1, [15] ],
[ ['Jude', 'Jud'], 1, [25] ],
[ ['Revelation', 'Rev', 'Re', 'The Revelation', 'Apocalipsis'], 22, [20,29,22,11,14,17,17,13,21,11,19,17,18,20,8,21,18,24,21,15,27,21] ],
]
for book_info in bible_books:
# cycle through each bible book, taking the number of chapters
# and verses and making a string like Jude1:25, 1Jude25, 1 Jude 25, etc
for book in book_info[0]:
sys.stdout.write("%s\n" % (book)) # Genesis
# step 1 - chapters
for chapter in range(1, book_info[1]+1):
# step 1 - verses
for verse_count in book_info[2]:
for verse in range(1, verse_count+1):
sys.stdout.write("%s %s %s\n" % (chapter, book, verse)) # 1 Genesis 2
sys.stdout.write("%s:%s:%s\n" % (chapter, book, verse)) # 1:Genesis:2
sys.stdout.write("%s%s%s\n" % (chapter, book, verse)) # 1Genesis2
sys.stdout.write("%s%s:%s\n" % (chapter, book, verse)) # 1Genesis:2
sys.stdout.write("%s %s:%s\n" % (book, chapter, verse)) # Genesis 1:2
sys.stdout.write("%s%s:%s\n" % (book, chapter, verse)) # Genesis1:2
sys.stdout.write("%s %s %s\n" % (book, chapter, verse)) # Genesis 1 2
sys.stdout.write("%s %s-%s\n" % (book, chapter, verse)) # Genesis 1-2
sys.stdout.write("%s-%s %s\n" % (book, chapter, verse)) # Genesis-1 2
sys.stdout.write("%s-%s:%s\n" % (book, chapter, verse)) # Genesis-1:2
return
#----------------------------------------------------------------------
def generate_quran():
quran_books = [
[ ['Al-Alaq'], 9 ],
[ ['Al-Qalam'], 52 ],
[ ['Al-Muzzammil'], 20 ],
[ ['Al-Muddathir'], 56 ],
[ ['Al-Fatiha'], 7 ],
[ ['Al-Masadd'], 5 ],
[ ['At-Takwir'], 29 ],
[ ['Al-Ala'], 19 ],
[ ['Al-Lail'], 21 ],
[ ['Al-Fajr'], 30 ],
[ ['Ad-Dhuha'], 11 ],
[ ['Al-Inshirah'], 8 ],
[ ['Al-Asr'], 3 ],
[ ['Al-Adiyat'], 11 ],
[ ['Al-Kauther'], 3 ],
[ ['At-Takathur'], 8 ],
[ ['Al-Maun'], 7 ],
[ ['Al-Kafiroon'], 6 ],
[ ['Al-Fil'], 5 ],
[ ['Al-Falaq'], 5 ],
[ ['An-Nas'], 6 ],
[ ['Al-Ikhlas'], 4 ],
[ ['An-Najm'], 62 ],
[ ['Abasa'], 42 ],
[ ['Al-Qadr'], 5 ],
[ ['Ash-Shams'], 15 ],
[ ['Al-Burooj'], 22 ],
[ ['At-Tin'], 8 ],
[ ['Quraish'], 4 ],
[ ['Al-Qaria'], 11 ],
[ ['Al-Qiyama'], 40 ],
[ ['Al-Humaza'], 9 ],
[ ['Al-Mursalat'], 50 ],
[ ['Qaf'], 45 ],
[ ['Al-Balad'], 20 ],
[ ['At-Tariq'], 17 ],
[ ['Al-Qamar'], 55 ],
[ ['Sad'], 88 ],
[ ['Al-Araf'], 206 ],
[ ['Al-Jinn'], 28 ],
[ ['Ya-Sin'], 83 ],
[ ['Al-Furqan'], 77 ],
[ ['Fatir'], 45 ],
[ ['Maryam'], 98 ],
[ ['Taha'], 135 ],
[ ['Al-Waqia'], 96 ],
[ ['Ash-Shuara'], 226 ],
[ ['An-Naml'], 93 ],
[ ['Al-Qasas'], 88 ],
[ ['Al-Isra'], 111 ],
[ ['Yunus'], 109 ],
[ ['Hud'], 123 ],
[ ['Yusuf'], 111 ],
[ ['Al-Hijr'], 99 ],
[ ['Al-Anaam'], 165 ],
[ ['As-Saaffat'], 182 ],
[ ['Luqman'], 34 ],
[ ['Saba'], 54 ],
[ ['Az-Zumar'], 75 ],
[ ['Al-Ghafir'], 85 ],
[ ['Fussilat'], 54 ],
[ ['Ash-Shura'], 53 ],
[ ['Az-Zukhruf'], 89 ],
[ ['Ad-Dukhan'], 59 ],
[ ['Al-Jathiya'], 37 ],
[ ['Al-Ahqaf'], 35 ],
[ ['Adh-Dhariyat'], 60 ],
[ ['Al-Ghashiya'], 26 ],
[ ['Al-Kahf'], 110 ],
[ ['An-Nahl'], 128 ],
[ ['Nooh'], 28 ],
[ ['Ibrahim'], 52 ],
[ ['Al-Ambiya'], 112 ],
[ ['Al-Mumenoon'], 118 ],
[ ['As-Sajda'], 30 ],
[ ['At-Tur'], 49 ],
[ ['Al-Mulk'], 30 ],
[ ['Al-Haaqqa'], 52 ],
[ ['Al-Maarij'], 44 ],
[ ['An-Naba'], 40 ],
[ ['An-Naziat'], 46 ],
[ ['Al-Infitar'], 19 ],
[ ['Al-Inshiqaq'], 25 ],
[ ['Ar-Room'], 60 ],
[ ['Al-Ankaboot'], 69 ],
[ ['Al-Mutaffifin'], 36 ],
[ ['Al-Baqara'], 286 ],
[ ['Al-Anfal'], 75 ],
[ ['Al-i-Imran'], 200 ],
[ ['Al-Ahzab'], 73 ],
[ ['Al-Mumtahina'], 13 ],
[ ['An-Nisa'], 176 ],
[ ['Al-Zalzala'], 8 ],
[ ['Al-Hadid'], 29 ],
[ ['Muhammad'], 38 ],
[ ['Ar-Rad'], 43 ],
[ ['Al-Rahman'], 78 ],
[ ['Al-Insan'], 31 ],
[ ['At-Talaq'], 12 ],
[ ['Al-Bayyina'], 8 ],
[ ['Al-Hashr'], 24 ],
[ ['An-Noor'], 64 ],
[ ['Al-Hajj'], 78 ],
[ ['Al-Munafiqoon'], 11 ],
[ ['Al-Mujadila'], 22 ],
[ ['Al-Hujraat'], 18 ],
[ ['At-Tahrim'], 12 ],
[ ['At-Taghabun'], 18 ],
[ ['As-Saff'], 14 ],
[ ['Al-Jumua'], 11 ],
[ ['Al-Fath'], 29 ],
[ ['Al-Maeda'], 120 ],
[ ['At-Taubah'], 129 ],
[ ['An-Nasr'], 3 ],
]
for book_info in quran_books:
# cycle through each Quran book, taking the number of verses
# and making a string like Nooh:1, 1Nooh, 1 Nooh, etc
for book in book_info[0]:
sys.stdout.write("%s\n" % (book)) # Nooh
# verses
for verse in range(1, book_info[1]+1):
sys.stdout.write("%s %s\n" % (book, verse)) # Nooh 1
sys.stdout.write("%s:%s\n" % (book, verse)) # Nooh:1
sys.stdout.write("%s-%s\n" % (book, verse)) # Nooh-1
sys.stdout.write("%s_%s\n" % (book, verse)) # Nooh_1
sys.stdout.write("%s%s\n" % (book, verse)) # Nooh1
sys.stdout.write("%s %s\n" % (verse, book)) # 1 Nooh
sys.stdout.write("%s:%s\n" % (verse, book)) # 1:Nooh
sys.stdout.write("%s-%s\n" % (verse, book)) # 1-Nooh
sys.stdout.write("%s_%s\n" % (verse, book)) # 1_Nooh
sys.stdout.write("%s%s\n" % (verse, book)) # 1Nooh
return
#----------------------------------------------------------------------
if __name__=='__main__':
from optparse import OptionParser
import os
# set up commandline arguments
Progname=os.path.basename(sys.argv[0])
optparser = OptionParser(version=__version__, usage=version())
optparser.add_option("-b", "--bible", dest = "bible", action="store_true", help="Generate Bible wordlist")
optparser.add_option("-q", "--quran", dest = "quran", action="store_true", help="Generate Quran wordlist")
optparser.add_option("-a", "--all", dest = "all", action="store_true", help="General All wordlists")
optparser.add_option("-o", "--output", dest = "output", action="store", help="Output filename")
(options, params) = optparser.parse_args()
if options.bible or options.all:
generate_bible()
if options.quran or options.all:
generate_quran()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment