2017-09-13 70 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]); 
相關問題