public virtual string[] getParentSenseKeys(string lemma, string pos, int sense) { ////System.err.println("JWNLDictionary.getParentSenseKeys: lemma="+lemma); this line was commented out in the java //try //{ Synset[] synsets = mEngine.GetSynsets(lemma, "noun"); //IndexWord indexWord= dict.getIndexWord(POS.NOUN, lemma); if (synsets.Length > sense) { //Synset synset = indexWord.getSense(sense + 1); //the sense+1 is because in JWNL sense ids start at 1 List <string> parents = new List <string>(); getParents(synsets[sense], parents); return(parents.ToArray()); //return (string[])SupportClass.ICollectionSupport.ToArray(parents, new string[parents.Count]); } else { return(empty); } //} //catch (JWNLException e) //{ // e.printStackTrace(); // return null; //} }
public virtual string[] GetParentSenseKeys(string lemma, string partOfSpeech, int sense) { Synset[] synsets = mEngine.GetSynsets(lemma, "noun"); if (synsets.Length > sense) { List <string> parents = new List <string>(); GetParents(synsets[sense], parents); return(parents.ToArray()); } else { return(empty); } }