
otbookdict = {
        "ge": "Genesis",
        "ex": "Exodus",
        "le": "Leviticus",
        "nu": "Numbers",
        "de": "Deuteronomy",
        "jos": "Joshua",
        "jdg": "Judges",
        "ru": "Ruth",
        "1sa": "1 Samuel",
        "2sa": "2 Samuel",
        "1ki": "1 Kings",
        "2ki": "2 Kings",
        "1ch": "1 Chronicles",
        "2ch": "2 Chronicles",
        "ezr": "Ezra",
        "ne": "Nehemiah",
        "est": "Esther",
        "job": "Job",
        "ps": "Psalms",
        "pr": "Proverbs",
        "ec": "Ecclesiastes",
        "so": "Song of Solomon",
        "is": "Isaiah",
        "je": "Jeremiah",
        "la": "Lamentations",
        "eze": "Ezekiel",
        "da": "Daniel",
        "ho": "Hosea",
        "joe": "Joel",
        "am": "Amos",
        "ob": "Obadiah",
        "jon": "Jonah",
        "mic": "Micah",
        "na": "Nahum",
        "hab": "Habakkuk",
        "zep": "Zephaniah",
        "hag": "Haggai",
        "zec": "Zechariah",
        "mal": "Malachi"
}

ntbookdict = {
        "mt": "Matthew",
        "mk": "Mark",
        "lk": "Luke",
        "jn": "John",
        "ac": "Acts",
        "ro": "Romans",
        "1co": "1 Corinthians",
        "2co": "2 Corinthians",
        "ga": "Galatians",
        "eph": "Ephesians",
        "php": "Philippians",
        "col": "Colossians",
        "1th": "1 Thessalonians",
        "2th": "2 Thessalonians",
        "1ti": "1 Timothy",
        "2ti": "2 Timothy",
        "ti": "Titus",
        "phm": "Philemon",
        "heb": "Hebrews",
        "jam": "James",
        "1pe": "1 Peter",
        "2pe": "2 Peter",
        "1jn": "1 John",
        "2jn": "2 John",
        "3jn": "3 John",
        "jud": "Jude",
        "rev": "Revelation"
}

idx2books = [
        "ge",
        "ex",
        "le",
        "nu",
        "de",
        "jos",
        "jdg",
        "ru",
        "1sa",
        "2sa",
        "1ki",
        "2ki",
        "1ch",
        "2ch",
        "ezr",
        "ne",
        "est",
        "job",
        "ps",
        "pr",
        "ec",
        "so",
        "is",
        "je",
        "la",
        "eze",
        "da",
        "ho",
        "joe",
        "am",
        "ob",
        "jon",
        "mic",
        "na",
        "hab",
        "zep",
        "hag",
        "zec",
        "mal",
        "mt",
        "mk",
        "lk",
        "jn",
        "ac",
        "ro",
        "1co",
        "2co",
        "ga",
        "eph",
        "php",
        "col",
        "1th",
        "2th",
        "1ti",
        "2ti",
        "ti",
        "phm",
        "heb",
        "jam",
        "1pe",
        "2pe",
        "1jn",
        "2jn",
        "3jn",
        "jud",
        "rev"
]

books2idx = {bookname: idx+1 for idx, bookname in enumerate(idx2books)}
idx2books = {idx: bookname for bookname, idx in books2idx.items()}

def wholebible_book_iterator():
    for bookabbr in otbookdict:
        yield bookabbr
    for bookabbr in ntbookdict:
        yield bookabbr


def getBookName(key):
    if key in otbookdict:
        return otbookdict[key]
    else:
        return ntbookdict[key]

numchaps = {
        "ge": 50,
        "ex": 40,
        "le": 27,
        "nu": 36,
        "de": 34,
        "jos": 24,
        "jdg": 21,
        "ru": 4,
        "1sa": 31,
        "2sa": 24,
        "1ki": 22,
        "2ki": 25,
        "1ch": 29,
        "2ch": 36,
        "ezr": 10,
        "ne": 13,
        "est": 10,
        "job": 42,
        "ps": 150,
        "pr": 31,
        "ec": 12,
        "so": 8,
        "is": 66,
        "je": 52,
        "la": 5,
        "eze": 48,
        "da": 12,
        "ho": 14,
        "joe": 3,
        "am": 9,
        "ob": 1,
        "jon": 4,
        "mic": 7,
        "na": 3,
        "hab": 3,
        "zep": 3,
        "hag": 2,
        "zec": 14,
        "mal": 4,
        "mt": 28,
        "mk": 16,
        "lk": 24,
        "jn": 21,
        "ac": 28,
        "ro": 16,
        "1co": 16,
        "2co": 13,
        "ga": 6,
        "eph": 6,
        "php": 4,
        "col": 4,
        "1th": 5,
        "2th": 3,
        "1ti": 6,
        "2ti": 4,
        "ti": 3,
        "phm": 1,
        "heb": 13,
        "jam": 5,
        "1pe": 5,
        "2pe": 3,
        "1jn": 5,
        "2jn": 1,
        "3jn": 1,
        "jud": 1,
        "rev": 22
}