예제 #1
0
파일: FixList.cs 프로젝트: JosefPihrt/Orang
        public FixList Add(string key, SpellingFix fix)
        {
            if (Items.TryGetValue(key, out ImmutableHashSet <SpellingFix>?fixes))
            {
                if (fixes.Contains(fix))
                {
                    return(this);
                }

                fixes = fixes.Add(fix);

                ImmutableDictionary <string, ImmutableHashSet <SpellingFix> > values = Items.SetItem(key, fixes);

                return(new FixList(values));
            }
            else
            {
                fixes = ImmutableHashSet.Create(SpellingFixComparer.InvariantCultureIgnoreCase, fix);

                ImmutableDictionary <string, ImmutableHashSet <SpellingFix> > dic = Items.Add(key, fixes);

                return(new FixList(dic));
            }
        }
예제 #2
0
 public override int Compare(SpellingFix x, SpellingFix y)
 {
     return(StringComparer.CurrentCulture.Compare(x.Value, y.Value));
 }
예제 #3
0
 public override int GetHashCode(SpellingFix obj)
 {
     return(WordList.DefaultComparer.GetHashCode(obj.Value));
 }
예제 #4
0
 public override bool Equals(SpellingFix x, SpellingFix y)
 {
     return(WordList.DefaultComparer.Equals(x.Value, y.Value));
 }
예제 #5
0
 public override int Compare(SpellingFix x, SpellingFix y)
 {
     return(WordList.DefaultComparer.Compare(x.Value, y.Value));
 }
예제 #6
0
 public override int GetHashCode(SpellingFix obj)
 {
     return(StringComparer.CurrentCulture.GetHashCode(obj.Value));
 }
예제 #7
0
 public override bool Equals(SpellingFix x, SpellingFix y)
 {
     return(StringComparer.CurrentCulture.Equals(x.Value, y.Value));
 }