if anyone know how i can use NTextCat in c#, I've downloaded but I found many of dll files, i don't know what i should use. This is its website http://ntextcat.codeplex.com i found i code:
var factory = new RankedLanguageIdentifierFactory();
var identifier = factory.Load("Core14.profile.xml");
var languages = identifier.Identify("your text to get its language identified");
var mostCertainLanguage = languages.FirstOrDefault();
if (mostCertainLanguage != null)
Console.WriteLine("The language of the text is '{0}' (ISO639-3 code)",mostCertainLanguage.Item1.Iso639_3);
else
Console.WriteLine("The language couldn’t be identified with an acceptable degree of certainty");
but what i should do first what a dll i should use ect..
I did it by the way, for who's interested:
IvanAkcheurov.NTextCat.Lib.dll
and add it to the references of the projectIn your code:
using IvanAkcheurov.NTextCat.Lib;
// ....
// <YOUR CODE>
// ....
var factory = new RankedLanguageIdentifierFactory();
var identifier = factory.Load("NTextCat 0.2.1.1\\LanguageModels\\Core14.profile.xml");
var languages = identifier.Identify("your text to get its language identified");
var mostCertainLanguage = languages.FirstOrDefault();
if (mostCertainLanguage != null)
Console.WriteLine("The language of the text is '{0}' (ISO639-3 code)",mostCertainLanguage.Item1.Iso639_3);
else
Console.WriteLine("The language couldn’t be identified with an acceptable degree of certainty");
In the line var identifier = factory.Load....
you must pay attention to language profile you'll need to use. For example, I use Wiki82.profile.xml
Go to "Manage Nuget Packages" in Visual Studio and Search for NTextCat... the nuget package will pop up (make sure it's the one by Ivan). Click install and it will install all DLLs needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With