Panlingo.LanguageIdentification.Whatlang.Native 0.2.0

dotnet add package Panlingo.LanguageIdentification.Whatlang.Native --version 0.2.0                
NuGet\Install-Package Panlingo.LanguageIdentification.Whatlang.Native -Version 0.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Panlingo.LanguageIdentification.Whatlang.Native" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Panlingo.LanguageIdentification.Whatlang.Native --version 0.2.0                
#r "nuget: Panlingo.LanguageIdentification.Whatlang.Native, 0.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Panlingo.LanguageIdentification.Whatlang.Native as a Cake Addin
#addin nuget:?package=Panlingo.LanguageIdentification.Whatlang.Native&version=0.2.0

// Install Panlingo.LanguageIdentification.Whatlang.Native as a Cake Tool
#tool nuget:?package=Panlingo.LanguageIdentification.Whatlang.Native&version=0.2.0                

Panlingo.LanguageIdentification.Whatlang

Welcome to Panlingo.LanguageIdentification.Whatlang, a .NET wrapper for the Whatlang library, which is an efficient and easy-to-use language detection library. This package simplifies the integration of language identification capabilities into .NET applications, leveraging the Whatlang library to accurately and quickly recognize the languages of given texts. Perfect for projects that require lightweight yet reliable language detection.

Requirements

  • Runtime: .NET >= 5.0
  • OS: Linux (Ubuntu, Debian), Windows 10+ or Windows Server 2019+, macOS
  • Arch: AMD64 (or ARM for macOS)

Installation

To integrate the Whatlang functionality, follow these steps:

  1. Install the NuGet package:

    dotnet add package Panlingo.LanguageIdentification.Whatlang
    

Usage

Integrating the Whatlang library into your .NET application is straightforward. Here’s a quick guide to get you started:

  1. Install the Package: Ensure you have added the Panlingo.LanguageIdentification.Whatlang package to your project using the provided installation command.
  2. Initialize the Library: Follow the example snippet to initialize and use the Whatlang library for detecting languages.
using Panlingo.LanguageIdentification.Whatlang;

class Program
{
    static void Main()
    {
        // Create an instance of the language detector
        using var whatlang = new WhatlangDetector();

        var texts = new[]
        {
            "Hello, how are you?",
            "Привіт, як справи?",
            "Привет, как дела?",
        };

        var predictions = texts
            .Select(x => new
            {
                Text = x,
                Prediction = whatlang.PredictLanguage(x),
            })
            .ToArray();

        foreach (var x in predictions)
        {
            Console.WriteLine(
                $"Text: {x.Text}, " +
                $"Language: {x.Prediction?.Language.ToString() ?? "NULL"}, " +
                $"Probability: {x.Prediction?.Confidence.ToString() ?? "NULL"}, " +
                $"IsReliable: {x.Prediction?.IsReliable.ToString() ?? "NULL"}, " +
                $"Script: {x.Prediction?.Script.ToString() ?? "NULL"}"
            );
        }
    }
}

Sources

  1. Original Whatlang Repository
  2. N-Gram-Based Text Categorization
  3. Language identification at Wikipedia

Supported languages

Language ISO 639-3 Enum
Esperanto epo WhatlangLanguage.Epo
English eng WhatlangLanguage.Eng
Russian rus WhatlangLanguage.Rus
Mandarin cmn WhatlangLanguage.Cmn
Spanish spa WhatlangLanguage.Spa
Portuguese por WhatlangLanguage.Por
Italian ita WhatlangLanguage.Ita
Bengali ben WhatlangLanguage.Ben
French fra WhatlangLanguage.Fra
German deu WhatlangLanguage.Deu
Ukrainian ukr WhatlangLanguage.Ukr
Georgian kat WhatlangLanguage.Kat
Arabic ara WhatlangLanguage.Ara
Hindi hin WhatlangLanguage.Hin
Japanese jpn WhatlangLanguage.Jpn
Hebrew heb WhatlangLanguage.Heb
Yiddish yid WhatlangLanguage.Yid
Polish pol WhatlangLanguage.Pol
Amharic amh WhatlangLanguage.Amh
Javanese jav WhatlangLanguage.Jav
Korean kor WhatlangLanguage.Kor
Bokmal nob WhatlangLanguage.Nob
Danish dan WhatlangLanguage.Dan
Swedish swe WhatlangLanguage.Swe
Finnish fin WhatlangLanguage.Fin
Turkish tur WhatlangLanguage.Tur
Dutch nld WhatlangLanguage.Nld
Hungarian hun WhatlangLanguage.Hun
Czech ces WhatlangLanguage.Ces
Greek ell WhatlangLanguage.Ell
Bulgarian bul WhatlangLanguage.Bul
Belarusian bel WhatlangLanguage.Bel
Marathi mar WhatlangLanguage.Mar
Kannada kan WhatlangLanguage.Kan
Romanian ron WhatlangLanguage.Ron
Slovene slv WhatlangLanguage.Slv
Croatian hrv WhatlangLanguage.Hrv
Serbian srp WhatlangLanguage.Srp
Macedonian mkd WhatlangLanguage.Mkd
Lithuanian lit WhatlangLanguage.Lit
Latvian lav WhatlangLanguage.Lav
Estonian est WhatlangLanguage.Est
Tamil tam WhatlangLanguage.Tam
Vietnamese vie WhatlangLanguage.Vie
Urdu urd WhatlangLanguage.Urd
Thai tha WhatlangLanguage.Tha
Gujarati guj WhatlangLanguage.Guj
Uzbek uzb WhatlangLanguage.Uzb
Punjabi pan WhatlangLanguage.Pan
Azerbaijani aze WhatlangLanguage.Aze
Indonesian ind WhatlangLanguage.Ind
Telugu tel WhatlangLanguage.Tel
Persian pes WhatlangLanguage.Pes
Malayalam mal WhatlangLanguage.Mal
Oriya ori WhatlangLanguage.Ori
Burmese mya WhatlangLanguage.Mya
Nepali nep WhatlangLanguage.Nep
Sinhalese sin WhatlangLanguage.Sin
Khmer khm WhatlangLanguage.Khm
Turkmen tuk WhatlangLanguage.Tuk
Akan aka WhatlangLanguage.Aka
Zulu zul WhatlangLanguage.Zul
Shona sna WhatlangLanguage.Sna
Afrikaans afr WhatlangLanguage.Afr
Latin lat WhatlangLanguage.Lat
Slovak slk WhatlangLanguage.Slk
Catalan cat WhatlangLanguage.Cat
Tagalog tgl WhatlangLanguage.Tgl
Armenian hye WhatlangLanguage.Hye

We value your feedback. Feel free to open issues or contribute to the repository. Let’s make language detection in .NET even more powerful and versatile! 🌍📝

Happy coding! 👩‍💻👨‍💻


Stay updated by following our repository. For any inquiries or support, reach out through the issues page.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Panlingo.LanguageIdentification.Whatlang.Native:

Package Downloads
Panlingo.LanguageIdentification.Whatlang

This is a .NET wrapper for the Whatlang library, which is an efficient and easy-to-use language detection library. This package simplifies the integration of language identification capabilities into .NET applications, utilizing the Whatlang library to accurately and quickly recognize the languages of given texts. Perfect for projects that require lightweight yet reliable language detection.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.0 106 11/10/2024
0.1.1 196 10/22/2024
0.0.0.23 133 10/7/2024
0.0.0.22 375 9/22/2024
0.0.0.21 160 9/10/2024
0.0.0.20 149 9/8/2024
0.0.0.19 151 9/1/2024
0.0.0.18 124 8/26/2024
0.0.0.17 164 8/21/2024
0.0.0.16 158 8/9/2024
0.0.0.15 132 8/8/2024
0.0.0.14 103 8/3/2024
0.0.0.13 111 8/1/2024
0.0.0.12 134 7/20/2024
0.0.0.10 122 7/14/2024

- Initial release