Module: Scripref::German

Defined in:
lib/scripref/german.rb

Overview

Mixin for parsing references in German.

Constant Summary collapse

BOOK_NAMES =

Array of book names.

<<-END.strip.split(/,\s*/)
  1. Mose, 2. Mose, 3. Mose, 4. Mose, 5. Mose, Josua, Richter, Ruth, 1. Samuel, 2. Samuel,
  1. Könige, 2.Könige, 1. Chronika, 2. Chronika, Esra, Nehemia, Esther, Hiob, Psalm,
  Sprüche, Prediger, Hohelied, Jesaja, Jeremia, Klagelieder, Hesekiel, Daniel, Hosea, Joel,
  Amos, Obadja, Jona, Micha, Nahum, Habakuk, Zephanja, Haggai, Sacharja, Maleachi,
  Matthäus, Markus, Lukas, Johannes, Apostelgeschichte, Römer, 1. Korinther, 2. Korinther,
  Galater, Epheser, Philipper, Kolosser, 1. Thessalonicher, 2. Thessalonicher, 1. Timotheus,
  2. Timotheus, Titus, Philemon, Hebräer, Jakobus, 1. Petrus, 2. Petrus, 1. Johannes,
  2. Johannes, 3. Johannes, Judas, Offenbarung
END
BOOKS_RES =

Array of regular expressions to match book names.

BOOK_NAMES.map do |bn|
  Regexp.new(bn.gsub(/([^1-5A-Z])/, '\1?').gsub('.', '\.') << '\b\s*')
end
BOOK_RE =

Regular expression to match a book.

Regexp.new(BOOKS_RES.map {|re| '(^' << re.to_s << ')' }.join('|'))
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_ADDON_RE =

Regular expression to match addons for a verse.

/([ab]|ff?)\s*/o
REFERENCE_RE =

Regular expression to parse a reference

/#{pass}(;\s*#{pass})*/o