0

I want to find out synonyms of a specific word Like "help". The synonyms of help are "aid", "assist" or "assistance" etc.

I have downloaded the Wordnet library and used this in Visual Studio.

  1. Create new project
  2. Download library of Wordnet using Manage NuGet Packages.
  3. Work with this code:

    WordNetEngine wne = new WordNetEngine();
    PartOfSpeech pos = new PartOfSpeech();
    SynSet ss = new SynSet(pos, 0, wne);
    Console.WriteLine("words form wordnet" + ss.Words);
    

But this is not working.

Please can anyone help me in this regard with code example in C#?

  • 2
    What do you mean by "not working"? – Pankaj Kapare May 24 '18 at 00:24
  • //Read the file and display it line by line. System.IO.StreamReader file = new System.IO.StreamReader(@"C:\Users\Ahmad\Downloads\wn3.1.dict\dict\dbfiles\noun.food"); while ((line1 = file.ReadLine()) != null) { System.Console.WriteLine(line1); counter++; } This code read file data but i don't know how to find out synonyms . – Muhammad Ahmad May 24 '18 at 07:41

1 Answers1

2

I do not know if you are still interested in this question, but these two Nuget Packages will help you:

https://developer.syn.co.in/tutorial/wordnet/tutorial.html

https://github.com/curiosity-ai/catalyst

In addition, please review the WordNet site for a complete guide about using the lexical database.