From d6c7e0259676da1645b7d261058acd4613fac4dd Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 9 Jul 2021 21:27:24 +0200 Subject: wiki: more aggressive whitespace cleanup --- skate/cmd/skate-wikipedia-doi/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'skate') diff --git a/skate/cmd/skate-wikipedia-doi/main.go b/skate/cmd/skate-wikipedia-doi/main.go index be3be0a..fe56576 100644 --- a/skate/cmd/skate-wikipedia-doi/main.go +++ b/skate/cmd/skate-wikipedia-doi/main.go @@ -18,6 +18,7 @@ var ( numWorkers = flag.Int("w", runtime.NumCPU(), "number of workers") batchSize = flag.Int("b", 100000, "batch size") bytesNewline = []byte("\n") + wsReplacer = strings.NewReplacer("\t", "", "\n", "", " ", "") ) func main() { @@ -32,7 +33,7 @@ func main() { return nil, nil } var ( - doi = strings.TrimSpace(ids.DOI) + doi = wsReplacer.Replace(ids.DOI) pageTitle = strings.TrimSpace(w.PageTitle) s = fmt.Sprintf("%s\t%s\t%s", doi, pageTitle, string(p)) ) -- cgit v1.2.3