Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion machine/scripture/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def parse_selection(selection: str, versification: Versification) -> Dict[int, L
selection = selection.strip()
chapters = {}

if selection[-1].isdigit(): # Specific chapters from one book
if selection[-1].isdigit() and len(selection) > 3: # Specific chapters from one book
book = book_id_to_number(selection[:3])
if book == 0:
raise ValueError(f"{selection[:3]} is an invalid book ID.")
Expand Down
1 change: 1 addition & 0 deletions tests/scripture/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test_get_books() -> None:
def test_get_chapters() -> None:
assert get_chapters([]) == {}
assert get_chapters("MAL") == {39: []}
assert get_chapters("PS2") == {84: []}
assert get_chapters("GEN,EXO") == {1: [], 2: []}
assert get_chapters("1JN,2JN") == {62: [], 63: []}
assert get_chapters("OT") == {i: [] for i in range(1, 40)}
Expand Down