reiver / go-porterstemmer

A native Go clean room implementation of the Porter Stemming algorithm.
https://godoc.org/github.com/reiver/go-porterstemmer
MIT License
190 stars 45 forks source link

StemString("ion") causes runtime exception #1

Closed OliverCardoza closed 10 years ago

OliverCardoza commented 11 years ago

Test Program

package main

import "fmt"
import "github.com/reiver/go-porterstemmer"

func main() {
    word := porterstemmer.StemString("ion")
    fmt.Println(word)
}

Output

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/reiver/go-porterstemmer.step4(0xc20003f2c0, 0x3, 0x3, 0xc20003f2c0, 0x3, ...)
    /home/oliver/go/src/github.com/reiver/go-porterstemmer/porterstemmer.go:691 +0x1550
github.com/reiver/go-porterstemmer.StemWithoutLowerCasing(0xc20003f2c0, 0x3, 0x3, 0x4e0143, 0x4e0142, ...)
    /home/oliver/go/src/github.com/reiver/go-porterstemmer/porterstemmer.go:895 +0xfd
github.com/reiver/go-porterstemmer.Stem(0xc20003f2c0, 0x3, 0x3, 0x3, 0x3, ...)
    /home/oliver/go/src/github.com/reiver/go-porterstemmer/porterstemmer.go:868 +0xc2
github.com/reiver/go-porterstemmer.StemString(0x4e0140, 0x3, 0x45ebb5, 0x4e8070)
    /home/oliver/go/src/github.com/reiver/go-porterstemmer/porterstemmer.go:839 +0x51
main.main()
    /home/oliver/go/src/thedarkesttimeline/test.go:7 +0x32

goroutine 2 [runnable]:
exit status 2
AndrewVos commented 10 years ago

Getting this too :(