### Quick Start Example Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/INDEX.md A basic example demonstrating how to use the lingua-go library to detect the language of a given text. It shows the essential steps of creating a detector and using it to identify the language. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Create a new language detector. // For performance reasons, you should create only one instance of the language detector // that you will use for the entire duration of your application. detector := lingua_go.NewLanguageDetectorBuilder().FromAllLanguages().Build() // Detect the language of a text. language := detector.DetectLanguageOf("This is a text in English.") // Print the result. fmt.Printf("The detected language is: %s\n", language.String()) } ``` -------------------------------- ### Complete Builder Example Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/builder.md Demonstrates the complete builder pattern for creating a LanguageDetector. This example configures the detector for specific European languages, sets a minimum relative distance, and preloads language models. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Create a detector for European languages with specific options detector := lingua.NewLanguageDetectorBuilder(). FromLanguages( lingua.English, lingua.German, lingua.French, lingua.Spanish, lingua.Italian, ). WithMinimumRelativeDistance(0.05). WithPreloadedLanguageModels(). Build() text := "This is an English sentence." if lang, ok := detector.DetectLanguageOf(text); ok { fmt.Printf("Detected: %s\n", lang) } else { fmt.Println("Could not reliably detect language") } } ``` -------------------------------- ### Install Lingua-Go using Go Get Source: https://github.com/pemistahl/lingua-go/blob/main/README.md Use this command to add the Lingua-Go library to your Go project dependencies. ```bash go get github.com/pemistahl/lingua-go ``` -------------------------------- ### Memory-Optimized Setup Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/SUMMARY.txt Illustrates how to configure the detector for memory optimization by using lazy loading of language models. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Create a new language detector with lazy loading enabled. detector := lingua.NewLanguageDetectorBuilder().FromAllLanguages().WithLazyLoading().Build() // Detect the language of a text. language := detector.DetectLanguageOf("This is a text in English.") // Print the result. fmt.Printf("The detected language is: %s\n", language.String()) } ``` -------------------------------- ### Complete Example: Mixed Language Processing with Confidence Values Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/confidence-result.md A comprehensive example demonstrating language detection for multiple languages in a single string, and calculating confidence values for each language. Includes setup, detection, and output of both detected sections and confidence scores. ```Go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { detector := lingua.NewLanguageDetectorBuilder(). FromLanguages( lingua.English, lingua.German, lingua.French, ). Build() text := "Hello world! Guten Morgen! Bonjour à tous!" // Detect multiple languages results := detector.DetectMultipleLanguagesOf(text) fmt.Println("Detected languages:") for _, result := range results { section := text[result.StartIndex():result.EndIndex()] fmt.Printf(" %s: %q\n", result.Language(), section) } // Get confidence values fmt.Println("\nConfidence values for full text:") confidences := detector.ComputeLanguageConfidenceValues(text) for _, cv := range confidences { fmt.Printf(" %s: %.2f%%\n", cv.Language(), cv.Value()*100) } } ``` -------------------------------- ### Builder Pattern - Configuration Recipes Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/SUMMARY.txt Provides examples of common configuration recipes for the language detector. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Recipe 1: High accuracy, all languages, lazy loading detector1 := lingua.NewLanguageDetectorBuilder().FromAllLanguages().WithAccuracy(lingua.HighAccuracy).WithLazyLoading().Build() language1 := detector1.DetectLanguageOf("This is a text in English.") fmt.Printf("Recipe 1: %s\n", language1.String()) // Recipe 2: Medium accuracy, specific languages, confidence threshold detector2 := lingua.NewLanguageDetectorBuilder().FromLanguages(lingua.English, lingua.French).WithAccuracy(lingua.MediumAccuracy).WithConfidenceThreshold(0.8).Build() language2 := detector2.DetectLanguageOf("This is a text in English.") fmt.Printf("Recipe 2: %s\n", language2.String()) } ``` -------------------------------- ### DetectionResult Usage Example Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/types.md Demonstrates how to extract a text section using the start and end indices provided by a DetectionResult. ```go section := text[result.StartIndex():result.EndIndex()] ``` -------------------------------- ### Build Lingua-Go from Source Source: https://github.com/pemistahl/lingua-go/blob/main/README.md Follow these steps to clone the repository and build the Lingua-Go executable. Ensure you have Go version 1.18 or higher installed. ```bash git clone https://github.com/pemistahl/lingua-go.git cd lingua-go go build ``` -------------------------------- ### Language Type Reference Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/SUMMARY.txt Provides examples of accessing language constants and their ISO codes. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Access a specific language constant. language := lingua.English fmt.Printf("Language: %s\n", language.String()) // Get ISO 639-1 code. iso639_1 := language.IsoCode639_1() fmt.Printf("ISO 639-1 code: %s\n", iso639_1.String()) // Get ISO 639-3 code. iso639_3 := language.IsoCode639_3() fmt.Printf("ISO 639-3 code: %s\n", iso639_3.String()) // Get language from ISO 639-1 code. langFromIso := lingua.NewIsoCode639_1("de") fmt.Printf("Language from ISO 639-1: %s\n", langFromIso.String()) // Get language from ISO 639-3 code. langFromIso3 := lingua.NewIsoCode639_3("fra") fmt.Printf("Language from ISO 639-3: %s\n", langFromIso3.String()) } ``` -------------------------------- ### Quick Start: Language Detection with Lingua-Go Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/README.md Demonstrates how to create a language detector, detect the language of a single text, compute confidence values, and detect multiple languages in mixed text. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Create detector for specific languages detector := lingua.NewLanguageDetectorBuilder(). FromLanguages(lingua.English, lingua.German, lingua.French). Build() // Detect single language text := "This is an English sentence." if lang, ok := detector.DetectLanguageOf(text); ok { fmt.Printf("Language: %s\n", lang) } // Get confidence values confidences := detector.ComputeLanguageConfidenceValues(text) for _, cv := range confidences { fmt.Printf("%s: %.2f%%\n", cv.Language(), cv.Value()*100) } // Detect multiple languages in mixed text mixed := "Hello world! Guten Tag! Bonjour!" results := detector.DetectMultipleLanguagesOf(mixed) for _, result := range results { section := mixed[result.StartIndex():result.EndIndex()] fmt.Printf("%s: '%s'\n", result.Language(), section) } } ``` -------------------------------- ### Create New Language Detector Builder Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/builder.md Initializes a new unconfigured language detector builder. This is the starting point for configuring language detection. ```go builder := lingua.NewLanguageDetectorBuilder() ``` -------------------------------- ### Language to ISO Code Conversion Example Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/isocode.md Demonstrates converting between Language types and their corresponding ISO 639-1 and ISO 639-3 codes, including conversion from string representations. ```go // Language to ISO code lang := lingua.English code1 := lang.IsoCode639_1() // Returns lingua.EN code3 := lang.IsoCode639_3() // Returns lingua.ENG // ISO code to Language isoCode := lingua.FR lang = lingua.GetLanguageFromIsoCode639_1(isoCode) // Returns lingua.French // String to ISO code to Language codeStr := "deu" code := lingua.GetIsoCode639_3FromValue(codeStr) lang = lingua.GetLanguageFromIsoCode639_3(code) // Returns lingua.German ``` -------------------------------- ### Lingua-go Type Import and Usage Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/types.md Shows how to import the lingua-go package and create a LanguageDetector instance using the builder pattern. This example configures the detector to recognize English and German. ```go import "github.com/pemistahl/lingua-go" // Usage detector := lingua.NewLanguageDetectorBuilder(). FromLanguages(lingua.English, lingua.German). Build() lang, ok := detector.DetectLanguageOf("text") ``` -------------------------------- ### Basic Language Detection in Go Source: https://github.com/pemistahl/lingua-go/blob/main/README.md This Go snippet demonstrates how to initialize a language detector for specific languages and detect the language of a given text. It shows the basic setup and usage of the DetectLanguageOf method. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { languages := []lingua.Language{ lingua.English, lingua.French, lingua.German, lingua.Spanish, } detector := lingua.NewLanguageDetectorBuilder(). FromLanguages(languages...). Build() if language, exists := detector.DetectLanguageOf("languages are awesome"); exists { fmt.Println(language) } // Output: English } ``` -------------------------------- ### Get Start Index of Detected Section Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/confidence-result.md Retrieves the starting character index of a detected single-language section. This index is relative to the original input text and is inclusive. ```go text := "Hello world. Bonjour le monde." results := detector.DetectMultipleLanguagesOf(text) for _, result := range results { startIdx := result.StartIndex() fmt.Printf("Starts at index: %d\n", startIdx) } ``` -------------------------------- ### Balanced Configuration Recipe Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/configuration.md A recommended configuration balancing accuracy, startup time, and memory usage. It uses lazy-loading and a moderate minimum relative distance for reliable detection. ```go detector := lingua.NewLanguageDetectorBuilder(). FromLanguages(lingua.English, lingua.German, lingua.French, lingua.Spanish). WithMinimumRelativeDistance(0.1). Build() ``` -------------------------------- ### Configuration Options - Eager/Lazy Loading Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/SUMMARY.txt Demonstrates the difference between eager and lazy loading of language models for performance and memory optimization. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Eager loading (default) detectorEager := lingua.NewLanguageDetectorBuilder().FromAllLanguages().Build() fmt.Println("Eager loading detector created.") // Lazy loading detectorLazy := lingua.NewLanguageDetectorBuilder().FromAllLanguages().WithLazyLoading().Build() fmt.Println("Lazy loading detector created.") // Detection with lazy loading only loads models when needed. language := detectorLazy.DetectLanguageOf("This is a text in English.") fmt.Printf("Detected language with lazy loading: %s\n", language.String()) } ``` -------------------------------- ### Lingua German Accuracy Report Example Source: https://github.com/pemistahl/lingua-go/blob/main/README.md This snippet shows an example of the accuracy report generated by Lingua for the German language, detailing detection accuracy for single words, word pairs, and sentences. ```text ##### German ##### >>> Accuracy on average: 89.23% >> Detection of 1000 single words (average length: 9 chars) Accuracy: 73.90% Erroneously classified as Dutch: 2.30%, Danish: 2.10%, English: 2.00%, Latin: 1.90%, Bokmal: 1.60%, Basque: 1.20%, French: 1.20%, Italian: 1.20%, Esperanto: 1.10%, Swedish: 1.00%, Afrikaans: 0.80%, Tsonga: 0.70%, Nynorsk: 0.60%, Portuguese: 0.60%, Yoruba: 0.60%, Finnish: 0.50%, Sotho: 0.50%, Welsh: 0.50%, Estonian: 0.40%, Irish: 0.40%, Polish: 0.40%, Spanish: 0.40%, Swahili: 0.40%, Tswana: 0.40%, Bosnian: 0.30%, Icelandic: 0.30%, Tagalog: 0.30%, Albanian: 0.20%, Catalan: 0.20%, Croatian: 0.20%, Indonesian: 0.20%, Lithuanian: 0.20%, Maori: 0.20%, Romanian: 0.20%, Xhosa: 0.20%, Zulu: 0.20%, Latvian: 0.10%, Malay: 0.10%, Slovak: 0.10%, Slovene: 0.10%, Somali: 0.10%, Turkish: 0.10% >> Detection of 1000 word pairs (average length: 18 chars) Accuracy: 94.10% Erroneously classified as Dutch: 0.90%, Latin: 0.80%, English: 0.70%, Swedish: 0.60%, Danish: 0.50%, French: 0.40%, Bokmal: 0.30%, Irish: 0.20%, Tagalog: 0.20%, Afrikaans: 0.10%, Esperanto: 0.10%, Estonian: 0.10%, Finnish: 0.10%, Italian: 0.10%, Maori: 0.10%, Nynorsk: 0.10%, Somali: 0.10%, Swahili: 0.10%, Tsonga: 0.10%, Turkish: 0.10%, Welsh: 0.10%, Zulu: 0.10% >> Detection of 1000 sentences (average length: 111 chars) Accuracy: 99.70% Erroneously classified as Dutch: 0.20%, Latin: 0.10% ``` -------------------------------- ### DetectionResult Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/types.md Interface representing a detected single-language section in mixed-language text. It provides the start and end indices of the section and the identified language. The indices follow Go convention (start inclusive, end exclusive), and the results are contiguous, non-overlapping, and ordered by appearance. ```APIDOC ## Interface: DetectionResult ### Description Interface representing a detected single-language section in mixed-language text. ### Methods - `StartIndex() int` - `EndIndex() int` - `Language() Language` ### Returns - `StartIndex()`: Zero-based start index (inclusive) - `EndIndex()`: Zero-based end index (exclusive) - `Language()`: Identified language ### Returned By `LanguageDetector.DetectMultipleLanguagesOf()` ### Usage Pattern ```go section := text[result.StartIndex():result.EndIndex()] ``` ### Properties - Indices follow Go convention (start inclusive, end exclusive) - Sections are contiguous and non-overlapping - Returned in order of appearance - Language is always reliably identified (never Unknown) ``` -------------------------------- ### Configuration Options - Language Selection Strategies Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/SUMMARY.txt Demonstrates different strategies for selecting languages during detector configuration. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Strategy 1: FromAllLanguages() detector1 := lingua.NewLanguageDetectorBuilder().FromAllLanguages().Build() fmt.Printf("Detector 1 supports all languages: %t\n", detector1.Is בכלLanguages()) // Strategy 2: FromLanguages() detector2 := lingua.NewLanguageDetectorBuilder().FromLanguages(lingua.English, lingua.Spanish).Build() fmt.Printf("Detector 2 supports English: %t\n", detector2.IsSupported(lingua.English)) // Strategy 3: FromIsoCodes639_1() detector3 := lingua.NewLanguageDetectorBuilder().FromIsoCodes639_1(lingua.IsoCode639_1_DE).Build() fmt.Printf("Detector 3 supports German: %t\n", detector3.IsSupported(lingua.German)) // Strategy 4: FromIsoCodes639_3() detector4 := lingua.NewLanguageDetectorBuilder().FromIsoCodes639_3(lingua.IsoCode639_3_FRA).Build() fmt.Printf("Detector 4 supports French: %t\n", detector4.IsSupported(lingua.French)) } ``` -------------------------------- ### Language Detector Configuration Summary Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/README.md Demonstrates the builder pattern for configuring a language detector. This includes selecting languages, setting optional parameters like minimum distance and preloading models, and finally building the detector. ```go detector := lingua.NewLanguageDetectorBuilder(). FromLanguages(lingua.English, lingua.German). // Required WithMinimumRelativeDistance(0.1). // Optional WithPreloadedLanguageModels(). // Optional WithLowAccuracyMode(). // Optional Build() // Terminal ``` -------------------------------- ### ISO Codes - Get ISO 639-3 From Value Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/SUMMARY.txt Demonstrates retrieving an ISO 639-3 code from its string value. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { isoCode, err := lingua.GetIsoCode639_3FromValue("eng") if err != nil { fmt.Printf("Error: %v\n", err) return } fmt.Printf("ISO 639-3 code: %s\n", isoCode.String()) } ``` -------------------------------- ### Lingua-Go Builder API Steps Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/configuration.md Demonstrates the sequential steps to create and configure a language detector using the Builder API. This includes selecting languages, setting optional configurations like minimum relative distance or low accuracy mode, and finally building the detector. ```go import "github.com/pemistahl/lingua-go" // Step 1: Create builder (always) builder := lingua.NewLanguageDetectorBuilder() // Step 2: Select languages (required, exactly one) // Example: builder = builder.FromLanguages(lingua.English, lingua.German) // OR // builder = builder.FromAllLanguages() // Step 3: Configure optional settings (any combination) // builder = builder.WithMinimumRelativeDistance(0.1) // builder = builder.WithPreloadedLanguageModels() // builder = builder.WithLowAccuracyMode() // Step 4: Build detector (terminal operation) detector := builder.Build() // Step 5: Use detector // language, ok := detector.DetectLanguageOf("text") ``` -------------------------------- ### ISO Codes - Get ISO 639-1 From Value Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/SUMMARY.txt Demonstrates retrieving an ISO 639-1 code from its string value. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { isoCode, err := lingua.GetIsoCode639_1FromValue("en") if err != nil { fmt.Printf("Error: %v\n", err) return } fmt.Printf("ISO 639-1 code: %s\n", isoCode.String()) } ``` -------------------------------- ### Get Confidence Score Value Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/confidence-result.md Retrieves the confidence score as a probability between 0.0 and 1.0. Values are sorted in descending order. ```go detector := lingua.NewLanguageDetectorBuilder(). FromLanguages(lingua.English, lingua.German, lingua.French). Build() confidences := detector.ComputeLanguageConfidenceValues("programming") for _, cv := range confidences { fmt.Printf("%s: %.4f\n", cv.Language(), cv.Value()) } // Output: // English: 0.7532 // German: 0.1544 // French: 0.0924 ``` -------------------------------- ### Configure Builder for All Languages Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/builder.md Sets up the builder to use all 75 supported languages for detection. Use this when you need to detect from the widest possible range of languages. ```go detector := lingua.NewLanguageDetectorBuilder(). FromAllLanguages(). Build() ``` -------------------------------- ### Get Language from ConfidenceValue Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/confidence-result.md Retrieves the language constant associated with a confidence score. Used to identify which language the score pertains to. ```go confidences := detector.ComputeLanguageConfidenceValues("Hello world") for _, cv := range confidences { fmt.Printf("Language: %s\n", cv.Language()) } ``` -------------------------------- ### Run Lingua-Go Unit Tests Source: https://github.com/pemistahl/lingua-go/blob/main/README.md Execute this command in the project's root directory to run the comprehensive unit test suite for Lingua-Go. ```bash go test ``` -------------------------------- ### Get Language from Detection Result Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/confidence-result.md Retrieves the identified language from a detection result. Returns Unknown if the section could not be reliably identified. ```Go func (r DetectionResult) Language() Language ``` -------------------------------- ### Builder Pattern Configuration Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/SUMMARY.txt Demonstrates configuring the language detector using the builder pattern, including language selection and accuracy modes. ```go package main import ( "fmt" "github.com/pemistahl/lingua-go" ) func main() { // Create a new language detector with specific configurations. detector := lingua.NewLanguageDetectorBuilder(). FromLanguages(lingua.English, lingua.Spanish). WithAccuracy(lingua.HighAccuracy). WithConfidenceThreshold(0.95). Build() // Detect the language of a text. language := detector.DetectLanguageOf("This is a text in English.") // Print the result. fmt.Printf("The detected language is: %s\n", language.String()) } ``` -------------------------------- ### Get Language from ISO 639-3 Code Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/language.md Retrieves a Language object using its ISO 639-3 code. Returns Unknown if the code is not found. ```Go func GetLanguageFromIsoCode639_3(isoCode IsoCode639_3) Language ``` ```Go language := lingua.GetLanguageFromIsoCode639_3(lingua.ENG) fmt.Println(language) // Output: English ``` -------------------------------- ### Builder Integration with ISO Codes Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/isocode.md Shows how to initialize the language detector using ISO 639-1 or ISO 639-3 codes. ```go // Using ISO 639-1 codes detector := lingua.NewLanguageDetectorBuilder(). FromIsoCodes639_1(lingua.EN, lingua.DE, lingua.FR). Build() // Using ISO 639-3 codes detector := lingua.NewLanguageDetectorBuilder(). FromIsoCodes639_3(lingua.ENG, lingua.DEU, lingua.FRA). Build() ``` -------------------------------- ### Get Language from ISO 639-1 Code Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/language.md Retrieves a Language object using its ISO 639-1 code. Returns Unknown if the code is not found. ```Go func GetLanguageFromIsoCode639_1(isoCode IsoCode639_1) Language ``` ```Go language := lingua.GetLanguageFromIsoCode639_1(lingua.EN) fmt.Println(language) // Output: English ``` -------------------------------- ### Build Language Detector and Detect Multiple Languages Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/confidence-result.md Demonstrates building a language detector for specific languages and then using it to detect multiple languages within a multi-line text. Shows how to extract language, start/end indices, and the corresponding text section. ```Go detector := lingua.NewLanguageDetectorBuilder(). FromLanguages( lingua.English, lingua.German, lingua.French, lingua.Spanish, ). Build() text := "\n This is English text.\n Das ist deutscher Text.\n Ceci est du texte français.\n Este es texto español.\n" results := detector.DetectMultipleLanguagesOf(text) for _, result := range results { section := text[result.StartIndex():result.EndIndex()] fmt.Printf( "%s [%d:%d]: %q\n", result.Language(), result.StartIndex(), result.EndIndex(), strings.TrimSpace(section), ) } ``` -------------------------------- ### Research/Testing Configuration (All Options) Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/configuration.md Enables all available configuration options for comprehensive testing and research. This includes all languages, preloaded models, and low accuracy mode for maximum coverage. ```go detector := lingua.NewLanguageDetectorBuilder(). FromAllLanguages(). WithPreloadedLanguageModels(). WithLowAccuracyMode(). Build() ``` -------------------------------- ### ISO Code String Representation Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/isocode.md Illustrates how to get the string representation of ISO 639-1 and ISO 639-3 codes using their String() methods. ```go code := lingua.EN fmt.Println(code.String()) // Output: EN code3 := lingua.ENG fmt.Println(code3.String()) // Output: ENG ``` -------------------------------- ### Get IsoCode639_3FromValue Function Source: https://github.com/pemistahl/lingua-go/blob/main/_autodocs/api-reference/isocode.md Retrieves the ISO 639-3 language code from a given string. The comparison is case-insensitive, and it returns UnknownIsoCode639_3 if no match is found. ```go func GetIsoCode639_3FromValue(name string) IsoCode639_3 ``` ```go code := lingua.GetIsoCode639_3FromValue("eng") fmt.Println(code) // Output: ENG code := lingua.GetIsoCode639_3FromValue("DEU") fmt.Println(code) // Output: DEU code := lingua.GetIsoCode639_3FromValue("invalid") fmt.Println(code) // Output: UnknownIsoCode639_3 ```