Module: Scripref::English

Extended by:
ConstReader
Defined in:
lib/scripref/english.rb

Overview

Mixin for parsing references in English.

Constant Summary collapse

BOOK_NAMES =

Array of book names.

Bookorder::CANONICAL.zip(book_names, book_abbrevs).map {|osis_book_id, names, abbrevs| Bookname.new(osis_id: osis_book_id, names: names, abbrevs: abbrevs)}
OSIS_BOOK_ID_TO_BOOK_NAME =

Map of OSIS book ID to instance of Bookname

Bookorder::CANONICAL.zip(BOOK_NAMES).map {|id, n| [id, n]}.to_h
CV_SEPARATOR =

Separator between chapter and verse.

':'
CV_SEP_RE =

Regular expression to match a separator between chapter and verse.

/:\s*/o
HYPHEN_SEPARATOR =

Separator between a range.

'-'
HYPHEN_RE =

Regular expression to match a hyphen.

/\s*-\s*/o
PASS_SEPARATOR =

Separator between passages.

'; '
PASS_SEP_RE =

Regular expression to match a separator between passages.

/;\s*/o
VERSE_SEP_RE =

Regular expression to match a separator between verses.

/,\s*/o
VERSE_SEPARATOR =

Separator between verses.

','
VERSE_ADDON_RE =

Regular expression to match addons for a verse.

/[abc]\s*/o
POSTFIX_ONE_FOLLOWING_VERSE =

Postfix for one following verse

'f'
POSTFIX_ONE_FOLLOWING_VERSE_RE =

Regular expression to match postfix for one following verse

/f\b\s*/o
POSTFIX_MORE_FOLLOWING_VERSES =

Postfix for more following verses

'ff'
POSTFIX_MORE_FOLLOWING_VERSES_RE =

Regular expression to match postfix for more following verses

/ff\b\s*/o
PUNCTUATION_MARKS_RE =

Regular expression to match punctuation marks

/[:;.\-]\s*/

Instance Method Summary collapse

Methods included from ConstReader

const_accessor, const_reader

Instance Method Details

#book_has_only_one_chapter?(osis_id) ⇒ Boolean

Check if book has only one chapter

Parameters:

  • osis_id

    OSIS-ID of the book

Returns:

  • (Boolean)


81
82
83
# File 'lib/scripref/english.rb', line 81

def book_has_only_one_chapter? osis_id
  %i[Obad Phlm 2John 3John Jude].include?(osis_id)
end