Simple language detection library written on pure Go.
- Require Go version >= 1.18
- Written on pure Go
- Supported languages: Armenian (am), German (de), Greek (el), English (en), Spanish (es), French (fr), Italian (it), Georgian (ka), Russian (ru)
- MIT license
go get github.com/wmentor/lang
package main
import (
"strings"
"github.com/wmentor/lang"
)
func main() {
println(lang.Detect(strings.NewReader("123 1231232332 12"))) // ??
println(lang.Detect(strings.NewReader("Hello, world!"))) // en
println(lang.Detect(strings.NewReader("Привет, мир!"))) // ru
println(lang.Detect(strings.NewReader("Hallo Welt!"))) // de
println(lang.Detect(strings.NewReader("Բարեւ աշխարհ!"))) // am
}