2017-09-13 73 views
0

我使用阿拉伯语词NET库获取给定的单词的同义词,但我没有得到任何结果,这是我用
阿拉伯语单词净同义词C#

awn = new AWN(@"..\..\awn.xml", true); 
List<string> words = new List<string>(); 
string str = awn.Get_Synset_ID_From_Word_Id("كثير"); 

的代码,但没有结果返回。 任何帮助?

+3

请提供更多的细节 –

+1

你有双重检查的路径'awn.xml'文件?尝试完整的绝对路径而不是相对路径。相对路径将从程序运行的位置开始。可能是您的项目文件夹下的Debug \ bin文件夹。 –

+0

@AhmedMagdy我需要得到一个给定的单词阿拉伯语的同义词,所以我使用阿拉伯语WordNet库。但字符串str总是空的,我不知道问题是什么。 –

回答

0

我解决了它如下

awn = new AWN(@"..\..\awn.xml", false); 
List<string> words = new List<string>(); 

//get Item Id of the word 
List<string> item_id = awn.Get_Item_Id_From_Name("عرض"); 

//get the synonyms of the word 
words = awn.Get_List_Word_Id_From_Synset_ID(item_id.First()); 

//get the word value for the first meaning 
string s = awn.Get_Word_Value_From_Word_Id(words[0]);