Panlingo.LanguageIdentification.CLD2
0.8.0
dotnet add package Panlingo.LanguageIdentification.CLD2 --version 0.8.0
NuGet\Install-Package Panlingo.LanguageIdentification.CLD2 -Version 0.8.0
<PackageReference Include="Panlingo.LanguageIdentification.CLD2" Version="0.8.0" />
<PackageVersion Include="Panlingo.LanguageIdentification.CLD2" Version="0.8.0" />
<PackageReference Include="Panlingo.LanguageIdentification.CLD2" />
paket add Panlingo.LanguageIdentification.CLD2 --version 0.8.0
#r "nuget: Panlingo.LanguageIdentification.CLD2, 0.8.0"
#:package Panlingo.LanguageIdentification.CLD2@0.8.0
#addin nuget:?package=Panlingo.LanguageIdentification.CLD2&version=0.8.0
#tool nuget:?package=Panlingo.LanguageIdentification.CLD2&version=0.8.0
Panlingo.LanguageIdentification.CLD2
Welcome to Panlingo.LanguageIdentification.CLD2, a .NET wrapper for the Compact Language Detector (CLD2) library by Google Inc. This package seamlessly integrates language identification capabilities into .NET applications, enabling accurate and efficient recognition of over 80 languages with minimal effort. Perfect for applications dealing with multilingual texts or requiring automatic language detection.
Requirements
- Runtime: .NET >= 5.0
- OS: Linux (Ubuntu, Debian), Windows 10+ or Windows Server 2019+, macOS
- Arch: x86_64 or arm64
Platform support
| OS / Arch | x86_64 | arm64 |
|---|---|---|
| Linux | ✅ | ✅ |
| Windows | ✅ | ✅ |
| macOS | ✅ | ✅ |
✅ — Full support | ❌ — No support | 🚧 — Under research
Native model version
The native CLD2 sources are pinned to commit b56fa78a2fe44ac2851bae5bf4f4693a0644da7b.
Installation
To integrate the CLD2 functionality, you need to add this NuGet package to your project:
dotnet add package Panlingo.LanguageIdentification.CLD2
Usage
Integrating the CLD2 library into your .NET application is straightforward. Here’s a quick guide to get you started:
- Install the Package: Ensure you have added the
Panlingo.LanguageIdentification.CLD2package to your project using the provided installation command. - Initialize the Library: Follow the example snippet to initialize and use the CLD2 library for detecting languages.
using Panlingo.LanguageIdentification.CLD2;
class Program
{
static void Main()
{
// Create an instance of the language detector
using var cld2 = new CLD2Detector();
// Input text to detect language
var predictions = cld2.PredictLanguage("Привіт, як справи?");
// Print the language
foreach (var prediction in predictions)
{
Console.WriteLine(
$"Language: {prediction.Language}, " +
$"Probability: {prediction.Probability}, " +
$"IsReliable: {prediction.IsReliable}, " +
$"Proportion: {prediction.Proportion}"
);
}
}
}
Alternatives
If you are exploring other options, here are some alternatives to consider:
- diadistis/cld2.net: An unmaintained wrapper for .NET.
- nuvi/NCLD2: Another unmaintained wrapper for .NET (NuGet).
- curiosity-ai/catalyst: Contains CLD2, with an example available here.
Supported languages
| Language Name | ISO 639-1 |
|---|---|
| Afrikaans | af |
| Albanian | sq |
| Arabic | ar |
| Armenian | hy |
| Azerbaijani | az |
| Basque | eu |
| Belarusian | be |
| Bengali | bn |
| Bihari | bh |
| Bulgarian | bg |
| Catalan | ca |
| Cebuano | ceb |
| Cherokee | chr |
| Croatian | hr |
| Czech | cs |
| Chinese | zh |
| Chinese_T | zh-Hant |
| Danish | da |
| Dhivehi | dv |
| Dutch | nl |
| English | en |
| Estonian | et |
| Finnish | fi |
| French | fr |
| Galician | gl |
| Ganda | lg |
| Georgian | ka |
| German | de |
| Greek | el |
| Gujarati | gu |
| Haitian_Creole | ht |
| Hebrew | iw |
| Hindi | hi |
| Hmong | hmn |
| Hungarian | hu |
| Icelandic | is |
| Indonesian | id |
| Inuktitut | iu |
| Irish | ga |
| Italian | it |
| Javanese | jw |
| Japanese | ja |
| Kannada | kn |
| Khmer | km |
| Kinyarwanda | rw |
| Korean | ko |
| Laothian | lo |
| Latvian | lv |
| Limbu | lif |
| Lithuanian | lt |
| Macedonian | mk |
| Malay | ms |
| Malayalam | ml |
| Maltese | mt |
| Marathi | mr |
| Nepali | ne |
| Norwegian | no |
| Oriya | or |
| Persian | fa |
| Polish | pl |
| Portuguese | pt |
| Punjabi | pa |
| Romanian | ro |
| Russian | ru |
| Scots_Gaelic | gd |
| Serbian | sr |
| Sinhalese | si |
| Slovak | sk |
| Slovenian | sl |
| Spanish | es |
| Swahili | sw |
| Swedish | sv |
| Syriac | syr |
| Tagalog | tl |
| Tamil | ta |
| Telugu | te |
| Thai | th |
| Turkish | tr |
| Ukrainian | uk |
| Urdu | ur |
| Vietnamese | vi |
| Welsh | cy |
| Yiddish | yi |
Sources
License
This project is licensed under the MIT License © 2024–2026 Alexander Gluschenko.
Includes software from the following project(s):
- CLD2 — © 2013 Google Inc., licensed under Apache-2.0
See the LICENSE file for full details.
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 is compatible. 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 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Panlingo.LanguageIdentification.CLD2.Native (>= 0.8.0)
-
net6.0
- Panlingo.LanguageIdentification.CLD2.Native (>= 0.8.0)
-
net7.0
- Panlingo.LanguageIdentification.CLD2.Native (>= 0.8.0)
-
net8.0
- Panlingo.LanguageIdentification.CLD2.Native (>= 0.8.0)
-
net9.0
- Panlingo.LanguageIdentification.CLD2.Native (>= 0.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.8.0 | 597 | 6/13/2026 |
| 0.7.2 | 17,923 | 1/9/2026 |
| 0.7.0 | 8,834 | 12/15/2025 |
| 0.6.5 | 42,040 | 10/26/2025 |
| 0.6.2 | 484 | 10/5/2025 |
| 0.6.1 | 3,198 | 9/5/2025 |
| 0.6.0 | 138,835 | 7/1/2025 |
| 0.5.0 | 281 | 6/18/2025 |
| 0.4.0 | 20,209 | 1/20/2025 |
| 0.3.0 | 259 | 12/15/2024 |
| 0.2.0 | 271 | 11/10/2024 |
| 0.1.1 | 321 | 10/22/2024 |
| 0.1.0 | 199 | 10/7/2024 |
| 0.0.0.22 | 257 | 9/22/2024 |
| 0.0.0.21 | 240 | 9/10/2024 |
| 0.0.0.20 | 217 | 9/8/2024 |
| 0.0.0.19 | 227 | 9/1/2024 |
| 0.0.0.18 | 207 | 8/26/2024 |
| 0.0.0.17 | 236 | 8/21/2024 |
| 0.0.0.16 | 233 | 8/9/2024 |
0.8.0
- Add managed/native package version validation at detector startup
- Improve UTF-8 text handling by passing explicit byte lengths to the native layer
- Return an empty result when native detection produces no predictions
- Throw ObjectDisposedException after the detector is disposed
- Add NuGet package icon and expanded package tags
0.7.0
- Windows and Linux: ARM64 support
0.6.1
- Windows: static linking of Visual C++ Runtime
0.4.0.0
- Add GetLanguages method
0.1.0.0
- Windows and MacOS support
0.0.0.1
- Initial release