fix code i carelessly broke
This commit is contained in:
parent
d4d3e7a043
commit
cd6b409971
|
@ -28,7 +28,7 @@ var htmlCharFilterRegexp = regexp.MustCompile(`</?[!\w]+((\s+\w+(\s*=\s*(?:".*?"
|
|||
|
||||
func CharFilterConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.CharFilter, error) {
|
||||
replaceBytes := []byte(" ")
|
||||
return regexpCharFilter.NewRegexpCharFilter(htmlCharFilterRegexp, replaceBytes), nil
|
||||
return regexpCharFilter.New(htmlCharFilterRegexp, replaceBytes), nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -36,7 +36,7 @@ func TestRegexpCharFilter(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, test := range tests {
|
||||
filter := NewRegexpCharFilter(htmlRegex, []byte{' '})
|
||||
filter := New(htmlRegex, []byte{' '})
|
||||
output := filter.Filter(test.input)
|
||||
if !reflect.DeepEqual(output, test.output) {
|
||||
t.Errorf("Expected:\n`%s`\ngot:\n`%s`\nfor:\n`%s`\n", string(test.output), string(output), string(test.input))
|
||||
|
@ -60,7 +60,7 @@ func TestZeroWidthNonJoinerCharFilter(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, test := range tests {
|
||||
filter := NewRegexpCharFilter(zeroWidthNonJoinerRegex, []byte{' '})
|
||||
filter := New(zeroWidthNonJoinerRegex, []byte{' '})
|
||||
output := filter.Filter(test.input)
|
||||
if !reflect.DeepEqual(output, test.output) {
|
||||
t.Errorf("Expected:\n`%s`\ngot:\n`%s`\nfor:\n`%s`\n", string(test.output), string(output), string(test.input))
|
||||
|
|
|
@ -28,7 +28,7 @@ var zeroWidthNonJoinerRegexp = regexp.MustCompile(`\x{200C}`)
|
|||
|
||||
func CharFilterConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.CharFilter, error) {
|
||||
replaceBytes := []byte(" ")
|
||||
return regexpCharFilter.NewRegexpCharFilter(zeroWidthNonJoinerRegexp, replaceBytes), nil
|
||||
return regexpCharFilter.New(zeroWidthNonJoinerRegexp, replaceBytes), nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
Loading…
Reference in New Issue