adding fetching and saving an entire book

This commit is contained in:
github_username_here
2026-03-10 17:48:17 +01:00
parent 7355158ff9
commit 874ba49512
157 changed files with 31768 additions and 32 deletions

View File

@@ -19,6 +19,7 @@ func StripAlternativeVersification(rawChapter config.Chapter) config.Chapter{
regExp:=regexp.MustCompile(`\(\d+:\d+\)`)
var treatedChapter config.Chapter
treatedChapter.Number = rawChapter.Number
for _, verse := range rawChapter.Verses{
modifiedVerse := string(regExp.ReplaceAll([]byte(verse), []byte("")))
log.Printf("%v\n", modifiedVerse)
@@ -29,7 +30,7 @@ func StripAlternativeVersification(rawChapter config.Chapter) config.Chapter{
}
func SplitInPart(verse string, properName map[string]struct{})([]string){
var parts []string
currentPart := ""
words := strings.Split(strings.TrimSpace(verse), " ")
@@ -39,7 +40,7 @@ func SplitInPart(verse string, properName map[string]struct{})([]string){
for i :=0 ; i < wordsCount ; i++{
word := words[i]
r, _ := utf8.DecodeRuneInString(word)
trimedWord := strings.TrimRight(word, ".,")
trimedWord := strings.TrimRight(word, ".,!;:")
_, isProperName := properName[trimedWord]
if i != 0 && unicode.IsUpper(r) && !isProperName{
parts = append(parts, currentPart)