pteichman / fate

ngram text synthesis with delusions of grandeur

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Index out of range error

andreas1974 opened this issue · comments

Hi, I tried Fate, but I get a lot of "index out of range errors". Some sentences work well and I get an answer back, but many times the program just crash with this out of range error.
I've tried saving my text input file with different encodings (UTF-8 with and without BOM, Windows ANSI and UCS-2), but it doesn't seem to matter much. With UTF-8 I get good looking answers until I get Index out of range.
Is it a known problem?
Best regards, Andreas Jansson.

Sample conversation below:

[Fate says:] Vad är det?
> det är något man sjunger
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/pteichman/fate.choice(0x116d6ce0, 0x5, 0x5, 0x729bd0, 0x117be3a8, 0x0
)
        C:/Users/AJ/go/src/github.com/pteichman/fate/model.go:314 +0x4d
github.com/pteichman/fate.(*Model).replyTokens(0x1175c0e0, 0x116d6ce0, 0x5, 0x5,
 0x729bd0, 0x117be3a8, 0x5, 0x8, 0xd63c1480)
        C:/Users/AJ/go/src/github.com/pteichman/fate/model.go:183 +0x4d
github.com/pteichman/fate.(*Model).Reply(0x1175c0e0, 0x116d6cc0, 0x1a, 0x0, 0x0)

        C:/Users/AJ/go/src/github.com/pteichman/fate/model.go:173 +0x14b
main.main()
        C:/Dev/fate-master/cmd/fate-console/main.go:66 +0x383
exit status 2

I fixed a bug on 32-bit systems last night and thought I'd make a sweep through the issues just to see if there's anything in there. Here you filed it four years ago! Ooof.

Thanks and apologies.

Fixed in fd6c4a6