speciale spaties -> gewone spaties

This commit is contained in:
Peter Kleiweg
2026-03-02 21:41:13 +01:00
parent a94b190108
commit fd750a8d47
10 changed files with 72 additions and 31 deletions

View File

@@ -206,6 +206,7 @@ func doArticle(filename string, url string, timestamp time.Time, needUpdate bool
// text bevat kopjes zonder punt aan het eind
lines := strings.Split(text, "\n")
for i, line := range lines {
line = fixSpace(line)
n := len(line)
if n > 0 {
if strings.ContainsAny(line[n-1:], ".!?") {
@@ -229,7 +230,7 @@ func doArticle(filename string, url string, timestamp time.Time, needUpdate bool
x(err)
} else {
for _, cat := range cats {
_, err := fmt.Fprintf(fp, "##META text cat = %s\n", cat)
_, err := fmt.Fprintf(fp, "##META text cat = %s\n", fixSpace(cat))
x(err)
}
}
@@ -241,3 +242,7 @@ func doArticle(filename string, url string, timestamp time.Time, needUpdate bool
return true
}
func fixSpace(s string) string {
return strings.Join(strings.Fields(s), " ")
}