how can i detect language with given text in c#

Jan 31 2024 6:19 AM

using LanguageDetection;

LanguageDetector ld = new LanguageDetector();
            ld.AddAllLanguages();
            string dasdfas = "????????";
            string lanCode = ld.Detect(dasdfas);

          //  string languageNaturalName = ld.Detect(lanCode); //returns "English" for language code "en"
            Console.WriteLine(lanCode);
            Console.ReadLine();

Iam using this code but it shows only english language 


Answers (6)