Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This PR introduces a robust Bible reference parser to the ScriptureBot application. It allows the bot to correctly identify and normalize Bible references from user messages, improving the reliability of passage retrieval.

Key features:

  • Normalization: Converts abbreviations (e.g., "gen", "1jn") to full book names ("Genesis", "1 John").
  • Fuzzy Matching: Handles typos using Levenshtein distance (e.g., "Gensis" -> "Genesis") with length-based thresholds to avoid false positives.
  • Identification: Distinguishes valid references from random text (e.g., "John is here" is rejected).
  • Smart Defaults:
    • Multi-chapter books default to Chapter 1 if no number is specified (e.g., "Genesis" -> "Genesis 1").
    • Single-chapter books (e.g., "Jude") are preserved as-is.
  • Integration: seamlessly integrated into the GetBiblePassage flow to enhance the default message handler.

PR created automatically by Jules for task 7479266757348735100 started by @julwrites

- Implemented `ParseBibleReference` in `pkg/app/bible_reference.go` to identify and normalize Bible references.
- Added fuzzy matching using Levenshtein distance to handle typos (e.g., "Gensis" -> "Genesis", "Mathew" -> "Matthew").
- Includes thresholds to prevent false positives on short words.
- Added comprehensive unit tests in `pkg/app/bible_reference_test.go`.
- Integrated parser into `GetBiblePassage` in `pkg/app/passage.go`.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@julwrites julwrites marked this pull request as ready for review November 28, 2025 17:19
@julwrites julwrites merged commit 42cc9d2 into staging Nov 28, 2025
1 check passed
@julwrites julwrites deleted the bible-ref-parser-fuzzy branch November 28, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants