go-lang-detector icon indicating copy to clipboard operation
go-lang-detector copied to clipboard

Wrong language detected

Open franco-bianco opened this issue 2 years ago • 0 comments

No longer seems to work

package main

import (
	"fmt"

	"github.com/chrisport/go-lang-detector/langdet"
	"github.com/chrisport/go-lang-detector/langdet/langdetdef"
)

var detector langdet.Detector

func init() {
	detector = langdetdef.NewWithDefaultLanguages()
}

func main() {
	testString := "do not care about quantity"
	result := detector.GetClosestLanguage(testString)
	fmt.Println(result)
}

Prints the following results:

> go run ./
hebrew

franco-bianco avatar Feb 13 '23 13:02 franco-bianco