Fix verse commentary validator to allow apostrophes and verse ranges

Updated the VerseCommentary validation regex pattern to support:
- Apostrophes in book names (e.g., "Solomon's Song")
- Verse ranges (e.g., "Genesis 1:4-5")

This brings the validator in line with other validators in the codebase
and fixes failing data validation tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-28 14:48:32 -05:00
parent bcce224700
commit 54e3b932d4
+1 -1
View File
@@ -132,7 +132,7 @@ class VerseCommentary(RootModel[Dict[str, VerseCommentaryEntry]]):
@classmethod
def check_verse_keys(cls, v):
import re
pattern = r'^[A-Za-z0-9 ]+ \d+:\d+$'
pattern = r"^[A-Za-z0-9 ']+ \d+:\d+(-\d+)?$"
for key in v.keys():
if not re.match(pattern, key):
raise ValueError(f"Invalid verse reference key: {key}")