Skip to content

Instantly share code, notes, and snippets.

@ayushoriginal
Created June 24, 2019 12:28
Show Gist options
  • Save ayushoriginal/0f8358fc2cccff538bec323dc7d846e9 to your computer and use it in GitHub Desktop.
Save ayushoriginal/0f8358fc2cccff538bec323dc7d846e9 to your computer and use it in GitHub Desktop.
LemmaSharp
var currentDirectory = Directory.GetCurrentDirectory();
var dataFilePath = string.Format("{0}/{1}", currentDirectory, "full7z-mlteast-en.lem");
var stream = File.OpenRead(dataFilePath);
var lemmatizer = new Lemmatizer(stream); //Load Lemmatizer with the given dataFilePath
List<string> lemma_tokens_str = new List<string>();
foreach (string word in stop_tokens_str)
{
var result2 = lemmatizer.Lemmatize(word);
lemma_tokens_str.Add(result2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment