Interface: ParsedReference
Defined in: Services/ReferenceParser.ts:23
Reference Parser
Parses Bible references from text strings. Supports various formats:
- "John 3:16" (single verse)
- "John 3:16-17" (verse range in same chapter)
- "John 3:16-4:2" (verse range across chapters)
- "John 3" (entire chapter)
- "John 3-5" (chapter range)
- "1 John 3:16" (numbered books)
- "Gen 1:1" (abbreviated names)
- "Genesis 1:1" (full names)
- "John 3:16, 17" (comma-separated verses)
Language-configurable: the constructor accepts optional book name tables and display names. English defaults are exported as constants so other Latin-script languages can provide their own tables while reusing the parsing logic. Languages with fundamentally different reference syntax (e.g., CJK) can implement the IReferenceParser interface directly.
Properties
book?
optionalbook?:number
Defined in: Services/ReferenceParser.ts:25
bookName?
optionalbookName?:string
Defined in: Services/ReferenceParser.ts:26
chapter?
optionalchapter?:number
Defined in: Services/ReferenceParser.ts:27
correctedBookName?
optionalcorrectedBookName?:string
Defined in: Services/ReferenceParser.ts:33
endChapter?
optionalendChapter?:number
Defined in: Services/ReferenceParser.ts:29
endVerse?
optionalendVerse?:number
Defined in: Services/ReferenceParser.ts:30
fuzzyMatch?
optionalfuzzyMatch?:boolean
Defined in: Services/ReferenceParser.ts:32
isValid
isValid:
boolean
Defined in: Services/ReferenceParser.ts:24
originalText
originalText:
string
Defined in: Services/ReferenceParser.ts:31
verse?
optionalverse?:number
Defined in: Services/ReferenceParser.ts:28
wholeBook?
optionalwholeBook?:boolean
Defined in: Services/ReferenceParser.ts:41
The reference names a book and nothing else ("John"), so it covers every
chapter. chapter is 1 and verse/endChapter/endVerse are absent —
the end is "wherever the book ends", which this parser has no chapter
counts to state. Only ever set when ReferenceParseOptions.allowWholeBook
is passed.