Commit d508d7c941d8c1f1b5fdce6fbab790d592093b3d

Authored by James McMinn
1 parent a23eac39b9
Exists in master

Fixed a stay function in lowercase filter

Showing 2 changed files with 2 additions and 21 deletions Side-by-side Diff

filter/lowercasefilter.go
... ... @@ -1,21 +0,0 @@
1   -// LowercaseFilter is badly named - rather than filter out lowercase characters,
2   -// as the name would imply, it converts text to lowercase.
3   -package filter
4   -
5   -import (
6   - "strings"
7   -)
8   -
9   -type LowercaseFilter struct {
10   -}
11   -
12   -func NewLowercaseFilter() *LowercaseFilter {
13   - return &LowercaseFilter{}
14   -}
15   -
16   -func (filter *LowercaseFilter) Filter(input []string) (output []string) {
17   - for i := range input {
18   - output = append(output, strings.ToLower(input[i]))
19   - }
20   - return output
21   -}
... ... @@ -50,6 +50,8 @@ func ReadLines(path string) ([]string, error) {
50 50 return lines, scanner.Err()
51 51 }
52 52  
  53 +// Removes URLs from a string, and returns the string along with
  54 +// any removed URLs
53 55 func URLFilter(text string) (clean string, urls []string) {
54 56 clean = text
55 57 for {