adding fetching and saving an entire book
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user