/// <summary> /// Returns a hash code for this token. /// </summary> /// <returns>A hash code for this token, suitable for use in hashing algorithms and data structures like a hash table.</returns> public override int GetHashCode() { unchecked { int hashCode = End; hashCode = (hashCode * 397) ^ Start; hashCode = (hashCode * 397) ^ (Lexeme != null ? Lexeme.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Lemmas != null ? Lemmas.GetHashCode() : 0); return(hashCode); } }
private void InitDefs() { _wordDict = Lemmas .Include(l => l.SynSets) .ThenInclude(sl => sl.SynSet) .ToDictionary( l => l.Value, l => l.SynSets .GroupBy(sl => sl.SynSet.Pos, sl => new Gloss { Definition = sl.SynSet.Definition, Example = sl.SynSet.Example }) .Select(grp => new PosGlosses { Pos = grp.Key, Glosses = grp.ToArray() }) .ToArray() ); _words = _wordDict.Keys.ToList(); _words.Sort(); }
public void ClearLemmas() { Lemmas.Clear(); }
public override int GetHashCode() { return(Lemmas.GetHashCode()); }
public void AddLemma(Entry lemma) { Lemmas.Add(lemma); }