detectlang

package
v0.1.77 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSupportedLanguageTags

func GetSupportedLanguageTags() []language.Tag

辅助函数:获取所有支持的语言标签

func IsSupportedLanguage

func IsSupportedLanguage(tag language.Tag) bool

辅助函数:检查语言是否受支持

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(languages []language.Tag) *Client

New initialization function

func (*Client) Detect

func (c *Client) Detect(text string) (*LanguageDetectionResult, error)

DetectLanguage detects the language of the given text

type LanguageDetectionResult

type LanguageDetectionResult struct {
	Language   language.Tag
	Confidence float64
}

LanguageDetectionResult stores the result of language detection

Jump to

Keyboard shortcuts

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