aboutsummaryrefslogtreecommitdiff
path: root/internal/bible/convert.go
blob: 6b9a66375cfc60a73b2ec6dc59402ef4de58fdae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package bible

import "regexp"

// Shared citation-normalisation regexes used by the book table (normalizeSigla)
// and the Ordinary Form reference renumbering (OFRef). The niedziela.pl Polish
// citation converter that once lived here (ToEnglishRef) was removed with the
// scraper: readings are now authored in English-canonical form.
var (
	iRe           = regexp.MustCompile(`\s+i\s+`)
	dashRe        = regexp.MustCompile(`\s*[-–—]\s*`)
	verseLetterRe = regexp.MustCompile(`(\d)[a-c]\b`)
	bookDotRe     = regexp.MustCompile(`(\p{L})\.`) // abbreviation dot after a letter ("Cor." -> "Cor")
	digitsRe      = regexp.MustCompile(`\d+`)
)