Documentation
¶
Overview ¶
Package snowball implements a stemmer
Example ¶
package main
import (
"fmt"
"github.com/tebeka/snowball"
)
func main() {
stemmer, err := snowball.New("english")
if err != nil {
fmt.Println("error", err)
return
}
defer stemmer.Close()
fmt.Println(stemmer.Stem("working"))
fmt.Println(stemmer.Stem("works"))
fmt.Println(stemmer.Stem("worked"))
}
Output: work work work
Index ¶
Examples ¶
Constants ¶
View Source
const (
// Version is the library version
Version = "0.8.0"
)
Variables ¶
View Source
var ( //go:embed "lib-version.txt" SnowballVersion string )
Functions ¶
Types ¶
type Stemmer ¶
type Stemmer struct {
// contains filtered or unexported fields
}
Stemmer structure. Warning: Stemmers are not goroutine safe, create a stemmer per goroutine or use a pool (such as sync.Pool) to ensure safety.
Click to show internal directories.
Click to hide internal directories.