/language-detection

.NET Port of Language Detection Library for Java

Primary LanguageC#Apache License 2.0Apache-2.0

Language Detection

.NET Port of Language Detection Library for Java by @shuyo

Install

Add a reference to LanguageDetection.dll.

Use

using LanguageDetection;

Load all supported languages

LanguageDetector detector = new LanguageDetector();
detector.AddAllLanguages();
Assert.AreEqual("lv", detector.Detect("čau, man iet labi, un kā iet tev?"));

or a small subset

LanguageDetector detector = new LanguageDetector();
detector.AddLanguages("lv", "lt", "en");
Assert.AreEqual("lv", detector.Detect("čau, man iet labi, un kā iet tev?"));

You can also change parameters

LanguageDetector detector = new LanguageDetector();
detector.RandomSeed = 1;
detector.ConvergenceThreshold = 0.9;
detector.MaxIterations = 50;

License

Apache 2.0