Socket
Socket
Sign inDemoInstall

github.com/rylans/getlang

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/rylans/getlang

Package getlang provides fast natural language detection for various languages getlang compares input text to a characteristic profile of each supported language and returns the language that best matches the input text


Version published

Readme

Source

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.

FAQs

Last updated on 27 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc