language

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package language provides language detection capabilities for media files and directories. It supports multiple detection methods and maintains language consistency across directory tree traversal to improve metadata accuracy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(req provider.Request, entries []os.DirEntry) (string, float64, string)

Detect determines the appropriate language for a media request based on multiple factors. It considers directory contents, parent request context, and defaults appropriately. Returns three values: - lang: the detected language code for the current request - confidence: detection confidence score (or -1 if not applicable) - childLang: the detected language for child directories based on their names

func Lingua

func Lingua(input string) (string, float64)

Lingua detects the language of the input text using the Lingua language detection library. It returns the ISO 639-1 language code and a confidence score between 0 and 1. If no language is detected, it defaults to English.

func NormalizeLanguage added in v0.3.0

func NormalizeLanguage(input string) string

NormalizeLanguage normalizes language string

func Whatlanggo

func Whatlanggo(input string) (string, float64)

Whatlanggo detects the language of the input text using the whatlanggo library. It returns the ISO 639-1 language code and a confidence score. This provides an alternative detection method to Lingua.

Types

This section is empty.

Jump to

Keyboard shortcuts

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