ReferenceExtractor class final

Finds parseable Bible passages embedded in arbitrary prose.

Extraction is parser-driven rather than tied to one language's book-name regular expression. Matches are returned from left to right, never overlap, and prefer the longest parse that begins at a given source offset.

Constructors

ReferenceExtractor({PassageParser? parser, bool includeBareBooks = false, int maxLookBehind = 96, int maxLookAhead = 256})

Properties

hashCode → int
The hash code for this object.
no setterinherited
includeBareBooks → bool
Whether whole-book passages without chapter or verse syntax are included.
final
maxLookAhead → int
Maximum number of UTF-16 code units searched after a numeric anchor.
final
maxLookBehind → int
Maximum number of UTF-16 code units searched before a numeric anchor.
final
parser → PassageParser
Parser used to validate every candidate span.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

extract(String source, {BibleLanguageEnum? language}) → List<PassageMatch>
Finds deterministic, non-overlapping passages in source.
findAll(String source, {BibleLanguageEnum? language}) → List<PassageMatch>
Alias for extract.
linkify(String source, PassageReplacement linkBuilder, {BibleLanguageEnum? language}) → String
Linkifies matches with a caller-provided renderer.
linkifyMarkdown(String source, {required PassageUriBuilder uriBuilder, String labelBuilder(PassageMatch match)?, BibleLanguageEnum? language}) → String
Replaces matches with Markdown links.
markdownLinkify(String source, {required PassageUriBuilder uriBuilder, String labelBuilder(PassageMatch match)?, BibleLanguageEnum? language}) → String
Alias for linkifyMarkdown.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceMatches(String source, PassageReplacement replacement, {BibleLanguageEnum? language}) → String
Replaces matches in one pass without scanning replacement text again.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited