Skip to content

Filters

Compare
Choose a tag to compare
@clipperhouse clipperhouse released this 29 May 01:10
· 29 commits to master since this release
619311b

Adds the ability to filter tokens. Use the Filter() method on Segmenter and Scanner.

Any func([]byte) bool can serve as a filter, with arbitrary logic. An example included filter is Wordlike, which removes whitespace and punctuation, returning only ‘words’ in the common sense.

See also the Contains() and Entirely() methods, which allow creation of filters based on Unicode categories.

Go Reference