fix voor zinnen aan elkaar
This commit is contained in:
@@ -161,6 +161,8 @@ func doArticle(filename string, url string, timestamp time.Time, needUpdate bool
|
||||
p(err)
|
||||
p(resp.Body.Close())
|
||||
|
||||
body = u.HtmlFix(body)
|
||||
|
||||
s := string(body)
|
||||
ok := true
|
||||
i1 := strings.Index(s, `<script type="application/ld+json"`)
|
||||
@@ -226,22 +228,9 @@ 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 = u.FixSpace(line)
|
||||
n := len(line)
|
||||
if n > 0 {
|
||||
if strings.ContainsAny(line[n-1:], ".!?") {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if n > 1 {
|
||||
s := line[n-2:]
|
||||
if s == `."` || s == `!"` || s == `?"` {
|
||||
continue
|
||||
}
|
||||
}
|
||||
lines[i] = line + "."
|
||||
lines[i] = u.AddEnd(u.FixSpace(line, true))
|
||||
}
|
||||
text = strings.Join(lines, "\n") + "\n"
|
||||
text = strings.Join(lines, "") + "\n"
|
||||
|
||||
fp, err := os.Create(filename + ".txt")
|
||||
p(err)
|
||||
|
||||
Reference in New Issue
Block a user