swordjs
Version:
swordjs - access modules from crosswire.org/sword in JS
506 lines (503 loc) • 22.5 kB
text/coffeescript
bcv_parser::regexps.space = "[\\s\\xa0]"
bcv_parser::regexps.escaped_passage = ///
(?:^ | [^\x1f\x1e\dA-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ] ) # Beginning of string or not in the middle of a word or immediately following another book. Only count a book if it's part of a sequence: `Matt5John3` is OK, but not `1Matt5John3`
(
# Start inverted book/chapter (cb)
(?:
(?: ch (?: apters? | a?pts?\.? | a?p?s?\.? )? \s*
\d+ \s* (?: [\u2013\u2014\-] | through | thru | to) \s* \d+ \s*
(?: from | of | in ) (?: \s+ the \s+ book \s+ of )?\s* )
| (?: ch (?: apters? | a?pts?\.? | a?p?s?\.? )? \s*
\d+ \s*
(?: from | of | in ) (?: \s+ the \s+ book \s+ of )?\s* )
| (?: \d+ (?: th | nd | st ) \s*
ch (?: apter | a?pt\.? | a?p?\.? )? \s* #no plurals here since it's a single chapter
(?: from | of | in ) (?: \s+ the \s+ book \s+ of )? \s* )
)? # End inverted book/chapter (cb)
\x1f(\d+)(?:/\d+)?\x1f #book
(?:
/\d+\x1f #special Psalm chapters
| [\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014]
| title (?! [a-z] ) #could be followed by a number
| chapter | verse | and | ff | -
| [a-e] (?! \w ) #a-e allows 1:1a
| $ #or the end of the string
)+
)
///gi
# These are the only valid ways to end a potential passage match. The closing parenthesis allows for fully capturing parentheses surrounding translations (ESV**)**. The last one, `[\d\x1f]` needs not to be +; otherwise `Gen5ff` becomes `\x1f0\x1f5ff`, and `adjust_regexp_end` matches the `\x1f5` and incorrectly dangles the ff.
bcv_parser::regexps.match_end_split = ///
\d \W* title
| \d \W* ff (?: [\s\xa0*]* \.)?
| \d [\s\xa0*]* [a-e] (?! \w )
| \x1e (?: [\s\xa0*]* [)\]\uff09] )? #ff09 is a full-width closing parenthesis
| [\d\x1f]
///gi
bcv_parser::regexps.control = /[\x1e\x1f]/g
bcv_parser::regexps.pre_book = "[^A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ]"
bcv_parser::regexps.first = "(?:Premye|1|I)\\.?#{bcv_parser::regexps.space}*"
bcv_parser::regexps.second = "(?:Dezy[èe]m|2|II)\\.?#{bcv_parser::regexps.space}*"
bcv_parser::regexps.third = "(?:3|III)\\.?#{bcv_parser::regexps.space}*"
bcv_parser::regexps.range_and = "(?:[&\u2013\u2014-]|and|-)"
bcv_parser::regexps.range_only = "(?:[\u2013\u2014-]|-)"
# Each book regexp should return two parenthesized objects: an optional preliminary character and the book itself.
bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) ->
books = [
osis: ["Ps"]
apocrypha: true
extra: "2"
regexp: ///(\b)( # Don't match a preceding \d like usual because we only want to match a valid OSIS, which will never have a preceding digit.
Ps151
# Always follwed by ".1"; the regular Psalms parser can handle `Ps151` on its own.
)(?=\.1)///g # Case-sensitive because we only want to match a valid OSIS.
,
osis: ["Gen"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:liv[\s\xa0]*Konmansman[\s\xa0]*an|Konmansman|Gen|Jen(?:[eè]z)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Exod"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:liv[\s\xa0]*delivrans[\s\xa0]*lan|Delivrans|E(?:xod|gz(?:[oò]d)?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Lev"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:liv[\s\xa0]*Prensip[\s\xa0]*lavi[\s\xa0]*nan[\s\xa0]*Bondye|Lev(?:itik)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Num"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:liv[\s\xa0]*Resansman[\s\xa0]*an|N(?:onb|um)|Res(?:ansman)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Sir"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Sir
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Wis"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Wis
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Lam"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Chante[\s\xa0]*pou[\s\xa0]*plenn[\s\xa0]*S[oò][\s\xa0]*lavil[\s\xa0]*Jerizal(?:[eè]m)|Lam(?:antasyon)?|Pl(?:enn)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["EpJer"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
EpJer
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Rev"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Apokalips|Rev(?:elasyon)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["PrMan"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
PrMan
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Deut"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
De(?:zy[eè]m[\s\xa0]*liv[\s\xa0]*Lalwa[\s\xa0]*a|ut|t(?:e[rw]on(?:[oò]m))?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Josh"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Jozye[\s\xa0]*a|Jo(?:sh|z(?:ye)?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Judg"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Ch[eè]f[\s\xa0]*yo|J(?:udg|ij))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Ruth"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Rit[\s\xa0]*la|R(?:uth|it))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["1Esd"]
apocrypha: true
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
1Esd
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["2Esd"]
apocrypha: true
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
2Esd
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u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:Kwonik|Istwa)|[\s\xa0]*(?:Kwonik|Istwa))|1(?:\.[\s\xa0]*(?:Kwonik|Istwa)|[\s\xa0]*(?:Kwonik|Ist(?:wa)?)|Chr))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Ezra"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Esdras[\s\xa0]*la|E(?:zra|sd(?:ras)?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Neh"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Neyemi[\s\xa0]*an|Ne(?:yemi|emi|h)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["GkEsth"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
GkEsth
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Esth"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Est[eè][\s\xa0]*a|Est[ehè]?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Job"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*J[oò]b[\s\xa0]*la|J[oò]b)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Ps"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*S[oò]m[\s\xa0]*yo|S[oò]m|Ps)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["PrAzar"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
PrAzar
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Prov"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Pwov[eè]b[\s\xa0]*yo|P(?:rov|w(?:ov[eè]b)?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Eccl"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Filoz[oò]f[\s\xa0]*la|Filoz[oò]f|E(?:ccl|kl(?:ezyas(?:[\s\xa0]*-?[\s\xa0]*Liv[\s\xa0]*Filoz[oò]f[\s\xa0]*la)?)?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["SgThree"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
SgThree
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Song"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Kantid[\s\xa0]*de[\s\xa0]*Kantik|Pi[\s\xa0]*b[eè]l[\s\xa0]*Chante[\s\xa0]*a|Chante(?:[\s\xa0]*Salomon)?|Song)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Jer"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Jeremi[\s\xa0]*an|Jer(?:emi)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Ezek"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Ezeky[eè]l[\s\xa0]*la|Eze(?:k(?:y[eè]l)?)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Dan"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Dany[eè]l[\s\xa0]*la|Dan(?:y[eè]l)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Hos"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Oze[\s\xa0]*a|Hos|Oze)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Joel"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Jow[eè]l[\s\xa0]*la|Jo(?:w[eè]l|el))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Amos"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Am[oò]s[\s\xa0]*la|Am[oò]s)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Obad"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Abdyas[\s\xa0]*la|Obad|Abd(?:[iy]as)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Jonah"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Jonas[\s\xa0]*la|Jona[hs])
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Mic"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Miche[\s\xa0]*a|Mic(?:he)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Nah"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Nawoum[\s\xa0]*lan|Na(?:h|w(?:ou[mn])?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Hab"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Abakik[\s\xa0]*la|Abak(?:ouk|ik)?|Hab)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Zeph"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Sofoni[\s\xa0]*an|Zeph|Sof(?:oni)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Hag"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Aje[\s\xa0]*a|Aje|Hag)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Zech"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Zakari[\s\xa0]*a|Z(?:ech|ak(?:ari)?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Mal"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Liv[\s\xa0]*Malachi[\s\xa0]*a|Mal(?:achi)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Matt"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
M(?:at(?:ye|t)?|t)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Mark"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
M(?:a(?:rk|k)|k)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Luke"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
L(?:uke|ik|k)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["1John"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Premye[\s\xa0]*Jan|I(?:\.[\s\xa0]*Jan|[\s\xa0]*Jan)|1(?:\.[\s\xa0]*Jan|John|[\s\xa0]*J(?:an|n)))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["2John"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Dezy[eè]m[\s\xa0]*Jan|II(?:\.[\s\xa0]*Jan|[\s\xa0]*Jan)|2(?:\.[\s\xa0]*Jan|John|[\s\xa0]*J(?:an|n)))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["3John"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:III[\s\xa0]*Jan|3(?:John|[\s\xa0]*J(?:an|n)))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["John"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
J(?:ohn|an|n)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Acts"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:A(?:k(?:syon[\s\xa0]*ap[oò]t[\s\xa0]*yo|d[eè]zapot)|cts)|Tr(?:avay(?:[\s\xa0]*ap[oò]t[\s\xa0]*yo)?)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Rom"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
R(?:om(?:en)?|òm)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["2Cor"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Dezy(?:[eè]m[\s\xa0]*Kor(?:entyen|int))|II(?:\.[\s\xa0]*Kor(?:entyen|int)|[\s\xa0]*Kor(?:entyen|int))|2(?:\.[\s\xa0]*Kor(?:entyen|int)|[\s\xa0]*Kor(?:entyen|int)?|Cor))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["1Cor"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Premye[\s\xa0]*Kor(?:entyen|int)|I(?:\.[\s\xa0]*Kor(?:entyen|int)|[\s\xa0]*Kor(?:entyen|int))|1(?:\.[\s\xa0]*Kor(?:entyen|int)|[\s\xa0]*Kor(?:entyen|int)?|Cor))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Gal"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Gal(?:as(?:yen|i))?
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Eph"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
E(?:ph|f(?:ez(?:yen)?|èz)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Phil"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Phil|Fil(?:ip(?:yen)?)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Col"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Col|Kol(?:os(?:yen)?|òs)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["2Thess"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Dezy(?:[eè]m[\s\xa0]*Tesalonik(?:yen)?)|II(?:\.[\s\xa0]*Tesalonik(?:yen)?|[\s\xa0]*Tesalonik(?:yen)?)|2(?:\.[\s\xa0]*Tesalonik(?:yen)?|Thess|[\s\xa0]*Tes(?:alonik(?:yen)?)?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["1Thess"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Premye[\s\xa0]*Tesalonik(?:yen)?|I(?:\.[\s\xa0]*Tesalonik(?:yen)?|[\s\xa0]*Tesalonik(?:yen)?)|1(?:\.[\s\xa0]*Tesalonik(?:yen)?|Thess|[\s\xa0]*Tes(?:alonik(?:yen)?)?))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["2Tim"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Dezy[eè]m[\s\xa0]*Timote|II(?:\.[\s\xa0]*Timote|[\s\xa0]*Timote)|2(?:\.[\s\xa0]*Timote|[\s\xa0]*Tim(?:ote)?|Tim))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["1Tim"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Premye[\s\xa0]*Timote|I(?:\.[\s\xa0]*Timote|[\s\xa0]*Timote)|1(?:\.[\s\xa0]*Timote|[\s\xa0]*Tim(?:ote)?|Tim))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Titus"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Tit(?:us)?
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Phlm"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Filem(?:on)?|Phlm)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Heb"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
(?:Heb|Eb(?:re)?)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Jas"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Ja[ks]
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["2Pet"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Dezy[eè]m[\s\xa0]*P(?:[iy][eè])|II(?:\.[\s\xa0]*P[iy][eè]|[\s\xa0]*P[iy][eè])|2(?:\.[\s\xa0]*P[iy][eè]|[\s\xa0]*P[iy][eè]|Pet))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["1Pet"]
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
(?:Premye[\s\xa0]*P[iy][eè]|I(?:\.[\s\xa0]*P[iy][eè]|[\s\xa0]*P[iy][eè])|1(?:\.[\s\xa0]*P[iy][eè]|[\s\xa0]*P[iy][eè]|Pet))
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Jude"]
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
J(?:ude|id)
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Tob"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Tob
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Jdt"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Jdt
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Bar"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Bar
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Sus"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Sus
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["Bel"]
apocrypha: true
regexp: ///(^|#{bcv_parser::regexps.pre_book})(
Bel
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["2Macc"]
apocrypha: true
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
2Macc
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["3Macc"]
apocrypha: true
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
3Macc
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["4Macc"]
apocrypha: true
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
4Macc
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
,
osis: ["1Macc"]
apocrypha: true
regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
1Macc
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)()\[\]/"'\*=~\-\u2013\u2014])|$)///gi
]
# Short-circuit the look if we know we want all the books.
return books if include_apocrypha is true and case_sensitive is "none"
# Filter out books in the Apocrypha if we don't want them. `Array.map` isn't supported below IE9.
out = []
for book in books
continue if include_apocrypha is false and book.apocrypha? and book.apocrypha is true
if case_sensitive is "books"
book.regexp = new RegExp book.regexp.source, "g"
out.push book
out
# Default to not using the Apocrypha
bcv_parser::regexps.books = bcv_parser::regexps.get_books false, "none"