Example #1
0
 public IEnumerable<Term> FindTermsByPOS(POS pos)
 {
     var result = from term in terms.Values
                  where term.PoS == pos
                  select term;
     return result;
 }
Example #2
0
        public override bool Equals(object obj)
        {
            bool equal = false;

            if (obj is POS)
            {
                POS other = (POS)obj;
                equal = _self == other.Value;
            }
            return(equal);
        }
Example #3
0
        protected override SynSet SelectSynset(string word, POS pos)
        {
            SynSet result = base.SelectSynset(word, pos); // temporary

            WordNetEngine.POS wordnetPos = pos.ForWordnet();
            if (wordnetPos != WordNetEngine.POS.None)
            {
                IGlossaryEntry glossEntry = glossary.FindWord(word);
                if (glossEntry == null)
                {
                    Set<SynSet> synsets = wordnet.GetSynSets(word, wordnetPos);
                    foreach (SynSet synset in synsets)
                    {
                        // great algorythms will be added here
                    }
                }
                else
                {
                    result = glossEntry.Synset;
                }
            }

            return result;
        }
Example #4
0
 protected virtual SynSet SelectSynset(string word, POS pos)
 {
     WordNetEngine.POS wordnetPOS = pos.ForWordnet();
     return (wordnetPOS == WordNetEngine.POS.None) ? null : wordnet.GetMostCommonSynSet(word, wordnetPOS);
 }