mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
459 B
22 lines
459 B
using LemmaSharp;
|
|
using ZeroLevel.Services.Semantic;
|
|
|
|
namespace Lemmatization
|
|
{
|
|
public class LemmaLexer
|
|
: ILexer
|
|
{
|
|
private readonly ILemmatizer _lemmatizer;
|
|
|
|
public LemmaLexer()
|
|
{
|
|
_lemmatizer = new LemmatizerPrebuiltFull(LanguagePrebuilt.Russian);
|
|
}
|
|
|
|
public string Lex(string word)
|
|
{
|
|
return _lemmatizer.Lemmatize(word.Trim().ToLowerInvariant());
|
|
}
|
|
}
|
|
}
|