Posts: 2
Joined: Mon Feb 19, 2018 10:37 am

Syn Wordnet

Mon Feb 19, 2018 11:26 am

Respected Developers;
the sample code for Syn.Wordnet shows how to extract synonyms but i also want to know how to get hyponyms and hypernyms as well. For example if input word is spoon i would like to get output word as cutlery because spoon is a cutlery. Any sample code to extract hyponyms and hypernyms will be highly appreciated.

User avatar
Help & Support
Posts: 320
Joined: Fri Oct 25, 2013 9:20 pm

Re: Syn Wordnet

Tue Feb 20, 2018 1:41 am

you can call the GetRelatedSynSets method and pass in the SynSetRelation to get hypernyms and hyponyms.

CSharp Code

Console.WriteLine("\nType word");

var word = Console.ReadLine();
var synSetList = wordNet.GetSynSets(word);

if (synSetList.Count == 0) Console.WriteLine($"No SynSet found for '{word}'");

foreach (var synSet in synSetList)
	var hypernyms = synSet.GetRelatedSynSets(SynSetRelation.Hypernym, true);
	foreach (var item in hypernyms)

Posts: 2
Joined: Mon Feb 19, 2018 10:37 am

Re: Syn Wordnet

Tue Feb 20, 2018 11:41 pm

it was very helpful. Thank you for your cooperation.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest