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 ¶
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 ¶
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
NormalizeLanguage normalizes language string
func Whatlanggo ¶
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.