I have seen the solution of this error message but it does not help, please help mere here.
string word = "hate";
string[] syn = S.GetSynonymsBySystem(word);
MessageBox.Show(syn[1].ToString());
When I run the above code, It does not show any error and give me the output in the messagebox as Emotion
. Which means that there are no errors of linking to wordnet library.
So, When I took an array of words in and saved in final
. And start searching one by one, Using the below code.
foreach (string keyword in final)
{
MessageBox.Show(keyword); //It shows the keyword here. which means no error in declaring my final array
string[] synonyms= S.GetSynonymsBySystem(keyword);
MessageBox.Show(synonyms.Length.ToString()); //Here is the error
}
I get the following error:
An unhandled exception of type "System.NullReferenceException" occured"
I dont know what is wrong? can any help me out? Thanks a lot.