cld2
--
import "cld2"
Package cld2 implements language detection using the Compact Language Detector.
This package includes the relevant sources from the cld2 project, so it doesn't
require any external dependencies. For more information about CLD2, see
https://code.google.com/p/cld2/.
Usage
func Detect
func Detect(text string) string
Detect returns the language code for detected language in the given text.
func DetectLang
func DetectLang(text string) Language {
DetectLang returns the Language type for detected language in the given text.
func DetectThree
func DetectThree(text string) Languages
DetectThree returns up to three language guesses.
type Languages struct {
Estimates []Estimate
TextBytes int
Reliable bool
}
type Estimate struct {
Language Language
Percent int
NormScore float64
}