Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 23, 2025

Overview

Enhanced the Verse class to include book and chapter metadata, addressing the requirement to return verse book and chapter information in the Get() (quick search) method. This change makes it easier to identify which book and chapter verses belong to when using the quick search functionality.

Changes

Core Library Changes

  • Verse.cs: Added three new properties to provide complete verse context:

    • BookNumber (int) - The book number (e.g., 1 for Genesis, 43 for John)
    • BookName (string) - The human-readable book name (e.g., "Genesis", "John")
    • ChapterNumber (int) - The chapter number
  • Bible.cs: Updated verse-returning methods to automatically populate the new metadata:

    • Get() - Quick search now includes book and chapter information
    • GetVerse() - Populates metadata for individual verse lookups
    • GetVerses() - Populates metadata for all verses in a chapter
  • Beblia.Sharp.csproj: Bumped version from 1.0.0 to 1.1.0

Documentation & Examples

  • README.md:

    • Added "Verse Metadata" to the features list
    • Included code examples demonstrating how to access the new properties
  • ConsoleSample/Program.cs: Enhanced examples to showcase the new metadata functionality

Usage Example

var verses = bible.Get("JN 3:16");
foreach (var verse in verses)
{
    Console.WriteLine($"{verse.BookName} {verse.ChapterNumber}:{verse.Number}");
    Console.WriteLine($"Book #{verse.BookNumber}: {verse.Text}");
}

Output:

John 3:16
Book #43: For God so loved the world, that he gave his only begotten Son...

Benefits

  • Better Context: Verses now carry their complete reference information
  • Simplified Code: No need to track book/chapter separately when working with verse results
  • Backward Compatible: Existing code continues to work unchanged; new properties are simply additional metadata
  • Consistent API: All verse-returning methods now provide the same level of detail

Testing

  • ✅ All builds succeed with 0 warnings and 0 errors
  • ✅ ConsoleSample demonstrates the new functionality correctly
  • ✅ Comprehensive testing of all scenarios (single verse, ranges, multiple verses)
  • ✅ CodeQL security analysis: 0 alerts found
  • ✅ NuGet package successfully created with version 1.1.0

Backward Compatibility

This change is fully backward compatible. The new properties are added to the Verse class but do not affect existing functionality. Code that doesn't use these properties will continue to work exactly as before.

Original prompt

in the get() (quick search) also return the verse book and chapter


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: russkyc <32549126+russkyc@users.noreply.github.com>
@russkyc
Copy link
Member

russkyc commented Oct 23, 2025

@copilot also bump version to 1.1.0

Copilot AI and others added 2 commits October 23, 2025 18:49
Co-authored-by: russkyc <32549126+russkyc@users.noreply.github.com>
Co-authored-by: russkyc <32549126+russkyc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add verse book and chapter to quick search Add book and chapter metadata to verse results in Get() and GetVerse() methods Oct 23, 2025
Copilot AI requested a review from russkyc October 23, 2025 18:54
Co-authored-by: russkyc <32549126+russkyc@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 23, 2025

@copilot also bump version to 1.1.0

Done! Version bumped to 1.1.0 in commit 290e8d8. The NuGet package now builds as Beblia.Sharp.1.1.0.nupkg.

@russkyc russkyc marked this pull request as ready for review October 23, 2025 18:59
@russkyc russkyc merged commit bbf0cec into master Oct 23, 2025
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