lang

package
Version: v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 2 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 (
	DefaultLanguage 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, string)

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 SupportedLanguages

func SupportedLanguages() []Language

SupportedLanguages returns a slice of supported by gnfinder languages.

func (Language) String

func (l Language) String() string

Source Files

Jump to

Keyboard shortcuts

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