go-lang-detector
go-lang-detector copied to clipboard
english example but output french
package main
import ( "fmt"
//"github.com/chrisport/go-lang-detector"
"github.com/chrisport/go-lang-detector/langdet/langdetdef"
)
func main() { detector := langdetdef.NewWithDefaultLanguages() testString := "do not care about quantity" result := detector.GetClosestLanguage(testString) fmt.Println(result) }
go run ./cmd/test/main.go french
go version go1.17.10 linux/amd64