Exemplo n.º 1
0
 private static Util.Set <string> GetSynsetSet(Context context)
 {
     Util.Set <string>   synsetSet  = new Util.HashSet <string>();
     string[]            lemmas     = GetLemmas(context);
     Mention.IDictionary dictionary = Mention.DictionaryFactory.GetDictionary();
     foreach (string lemma in lemmas)
     {
         synsetSet.Add(dictionary.GetSenseKey(lemma, PartsOfSpeech.NounSingularOrMass, 0));
         string[] synsets = dictionary.GetParentSenseKeys(lemma, PartsOfSpeech.NounSingularOrMass, 0);
         for (int currentSynset = 0, sn = synsets.Length; currentSynset < sn; currentSynset++)
         {
             synsetSet.Add(synsets[currentSynset]);
         }
     }
     return(synsetSet);
 }
Exemplo n.º 2
0
 private static Util.Set <string> GetSynsetSet(Context context)
 {
     Util.Set <string>   synsetSet  = new Util.HashSet <string>();
     string[]            lemmas     = GetLemmas(context);
     Mention.IDictionary dictionary = Mention.DictionaryFactory.GetDictionary();
     //System.err.println(lemmas.length+" lemmas for "+c.headToken);
     for (int currentLemma = 0; currentLemma < lemmas.Length; currentLemma++)
     {
         synsetSet.Add(dictionary.GetSenseKey(lemmas[currentLemma], "NN", 0));
         string[] synsets = dictionary.GetParentSenseKeys(lemmas[currentLemma], "NN", 0);
         for (int currentSynset = 0, sn = synsets.Length; currentSynset < sn; currentSynset++)
         {
             synsetSet.Add(synsets[currentSynset]);
         }
     }
     return(synsetSet);
 }