Skip to content
Natural language detection package in pure Go
Branch: master
Clone or download
danielmltn and rylans cleaned up pieces of code, adjusted naming for better clarity (#14)
* cleaned up pieces of code, adjusted naming for better clarity

* used appends variadic function, cleaned intializations

* added efficiency to slice creation in getlang.go
Latest commit 0a0f3a5 Jun 17, 2019

README.md

getlang

GoDoc Go Report Card Build Status cover.run go

getlang provides fast natural language detection in Go.

Features

  • Offline -- no internet connection required
  • Supports 29 languages
  • Provides ISO 639 language codes
  • Fast

Getting started

Installation:

    go get -u github.com/rylans/getlang

example:

package main

import (
	"fmt"
	"github.com/rylans/getlang"
)

func main(){
  info := getlang.FromString("Wszyscy ludzie rodzą się wolni i równi w swojej godności i prawach")
  fmt.Println(info.LanguageCode(), info.Confidence())
}

Documentation

getlang on godoc

License

MIT

Acknowledgements and Citations

  • Thanks to abadojack for the trigram generation logic in whatlanggo
  • Cavnar, William B., and John M. Trenkle. "N-gram-based text categorization." Ann arbor mi 48113.2 (1994): 161-175.
You can’t perform that action at this time.