lang

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LanguagesSet

func LanguagesSet() map[Language]struct{}

LanguagesSet returns a 'set' of languages for more effective lookup of a language.

Types

type Language

type Language int

Language represents the language of a text.

const (
	UnknownLanguage Language = iota
	English
	German
	NotSet
)

Set of languages. Last one is an indicator of the 'edge', as well as a default value for GnFinder.Language.

func DetectLanguage

func DetectLanguage(text []rune) Language

DetectLanguage finds the most probable language for a text.

func NewLanguage

func NewLanguage(lang string) (Language, error)

NewLanguage takes a string and returns matching language, or error, if a matching language cannot be found.

func (Language) String

func (l Language) String() string

Jump to

Keyboard shortcuts

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