lang

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 7 Imported by: 1

README

lang

test

Simple language detection library written on pure Go.

Summary

  • Require Go version >= 1.18
  • Written on pure Go
  • Supported languages: Armenian (am), German (de), Greek (el), English (en), Spanish (es), French (fr), Italian (it), Georgian (ka), Russian (ru)
  • MIT license

Install

go get github.com/wmentor/lang

Usage

package main

import (
  "strings"

  "github.com/wmentor/lang"
)

func main() {
  println(lang.Detect(strings.NewReader("123 1231232332 12"))) // ??
  println(lang.Detect(strings.NewReader("Hello, world!")))     // en
  println(lang.Detect(strings.NewReader("Привет, мир!")))      // ru
  println(lang.Detect(strings.NewReader("Hallo Welt!")))       // de
  println(lang.Detect(strings.NewReader("Բարեւ աշխարհ!")))     // am
}

Documentation

Index

Constants

View Source
const (
	UnknownLang string = "??"
)

Variables

View Source
var (
	Langs []string
)

Functions

func Conflicts

func Conflicts()

func Detect

func Detect(in io.Reader) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL