In C# i using
using word = Microsoft.Office.Interop.Word;
For get a Synonym for words by using this code
var app = new word.Application();
var infosyn = app.SynonymInfo[Wtext[Op + 1].ToString(), word.WdLanguageID.wdArabic];
foreach (var item in infosyn.MeaningList as Array)
{
listBox1.Items.Add(item.ToString());
}
Image here
My Issue is i got only the meaning list ( What is red boxes in image), but i want all words like in the image ( words in red boxes and blue arrows, The whole list). Note: i use Meaninglist, RelatedWordList and it's not working and make loops in loop take a each synonym words and check their synonyms. Like This
var apps = new words.Application();
var infosyns = apps.SynonymInfo[item.ToString(), words.WdLanguageID.wdArabic] ;
foreach (var iitem in infosyns.MeaningList as Array)
{
listBox1.Items.Add(iitem.ToString());
var appss = new wordss.Application();
var infosynss = appss.SynonymInfo[iitem.ToString(),wordss.WdLanguageID.wdArabic] ;
foreach (var iiitem in infosyns.MeaningList as Array)
{
listBox1.Items.Add(iiitem.ToString());
}
}
Image here
I had a similar problem, however by looping a predefined amount of times through the results, I got a lot more. This was just a quick code and I believe the efficiency could be improved, However I believe it will get you on the right track. (It is somewhat similar to what you have done.
Basically this function gets all the related words and then recursively adds the related word and finds their related words. This ends up by very closely resembling your result if you set the maxSize to 15;