add Douay-Rheims Bible to the project for english bible references
All checks were successful
CI / update (push) Successful in 19s

This commit is contained in:
2026-02-11 10:15:54 +01:00
parent 35ea60e637
commit 01ccc705ee
7 changed files with 36472 additions and 40 deletions

View File

@@ -10,16 +10,17 @@ export interface BibleVerse {
text: string;
}
let cachedVerses: BibleVerse[] | null = null;
const versesCache = new Map<string, BibleVerse[]>();
export function loadVersesFromFile(tsvPath?: string): BibleVerse[] {
if (cachedVerses) return cachedVerses;
const filePath = tsvPath ?? resolve('static/allioli.tsv');
const cached = versesCache.get(filePath);
if (cached) return cached;
const content = readFileSync(filePath, 'utf-8');
const lines = content.trim().split('\n');
cachedVerses = lines.map((line) => {
const verses = lines.map((line) => {
const [bookName, abbreviation, bookNumber, chapter, verseNumber, text] = line.split('\t');
return {
bookName,
@@ -31,7 +32,8 @@ export function loadVersesFromFile(tsvPath?: string): BibleVerse[] {
};
});
return cachedVerses;
versesCache.set(filePath, verses);
return verses;
}
function parseReference(reference: string) {