Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rylans/getlang
Natural language detection package in pure Go
https://github.com/rylans/getlang
language-model natural-language nlp
Last synced: 3 months ago
JSON representation
Natural language detection package in pure Go
- Host: GitHub
- URL: https://github.com/rylans/getlang
- Owner: rylans
- License: mit
- Created: 2018-03-01T21:27:30.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-12-27T07:47:21.000Z (about 4 years ago)
- Last Synced: 2024-07-31T20:52:33.259Z (6 months ago)
- Topics: language-model, natural-language, nlp
- Language: Go
- Homepage:
- Size: 55.7 KB
- Stars: 168
- Watchers: 5
- Forks: 21
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - getlang - Fast natural language detection package. (Natural Language Processing / Language Detection)
- zero-alloc-awesome-go - getlang - Fast natural language detection package. (Natural Language Processing / Language Detection)
- awesome-ccamel - rylans/getlang - Natural language detection package in pure Go (Go)
- awesome-go - getlang - Natural language detection package in pure Go - ★ 32 (Natural Language Processing)
- awesome-go-extra - getlang - 03-01T21:27:30Z|2020-12-27T07:47:21Z| (Bot Building / Language Detection)
- awesome-go-zh - getlang
README
# getlang
[![GoDoc](https://godoc.org/github.com/rylans/getlang?status.svg)](https://godoc.org/github.com/rylans/getlang) [![Go Report Card](https://goreportcard.com/badge/github.com/rylans/getlang)](https://goreportcard.com/report/github.com/rylans/getlang) [![Build Status](https://travis-ci.org/rylans/getlang.svg?branch=master)](https://travis-ci.org/rylans/getlang) ![cover.run go](https://cover.run/go/github.com/rylans/getlang.svg?tag=golang-1.10)
getlang provides fast natural language detection in Go.
## Features
* Offline -- no internet connection required
* Supports [29 languages](https://github.com/rylans/getlang/blob/master/LANGUAGES.md)
* Provides ISO 639 language codes
* Fast## Getting started
Installation:
```sh
go get -u github.com/rylans/getlang
```example:
```go
package mainimport (
"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](https://godoc.org/github.com/rylans/getlang)## License
[MIT](https://github.com/rylans/getlang/blob/master/LICENSE)## Acknowledgements and Citations
* Thanks to [abadojack](https://github.com/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.