Skip to content

Commit

Permalink
Wrote necessary plus some additional tests to
Browse files Browse the repository at this point in the history
investigate possible alignment and versification
issues with deuterocanonical books
  • Loading branch information
mudiagaobrikisil committed Jan 22, 2025
1 parent 3b98936 commit ec49343
Show file tree
Hide file tree
Showing 4 changed files with 966 additions and 1 deletion.
32 changes: 32 additions & 0 deletions src/SIL.Machine/Scripture/ScVersExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System.Collections.Generic;

namespace SIL.Scripture.Extensions
{
public static class ScrVersExtensions
{
/// <summary>
/// Gets a list of references (verse references) for the specified book.
/// </summary>
public static IEnumerable<VerseRef> GetReferencesForBook(this ScrVers scrVers, int bookNum)
{
List<VerseRef> references = new List<VerseRef>();
int lastChapter = scrVers.GetLastChapter(bookNum);

for (int chapterNum = 1; chapterNum <= lastChapter; chapterNum++)
{
int lastVerse = scrVers.GetLastVerse(bookNum, chapterNum);

for (int verseNum = 1; verseNum <= lastVerse; verseNum++)
{
int bbbcccvvv = VerseRef.GetBBBCCCVVV(bookNum, chapterNum, verseNum);
if (!scrVers.IsExcluded(bbbcccvvv))
{
references.Add(new VerseRef(bookNum, chapterNum, verseNum, scrVers));
}
}
}

return references;
}
}
}
Loading

0 comments on commit ec49343

Please sign in to comment.