Esempio n. 1
0
 protected bool Equals(ModifiedKneserNey other)
 {
     return(N11 == other.N11 && N12 == other.N12 && N13 == other.N13 && N14 == other.N14 &&
            N21 == other.N21 && N22 == other.N22 && N23 == other.N23 && N24 == other.N24 &&
            Math.Abs(_d11 - other._d11) < 0.00001 &&
            Math.Abs(_d12 - other._d12) < 0.00001 &&
            Math.Abs(_d13 - other._d13) < 0.00001 &&
            Math.Abs(_d21 - other._d21) < 0.00001 &&
            Math.Abs(_d22 - other._d22) < 0.00001 &&
            Math.Abs(_d23 - other._d23) < 0.00001 &&
            Math.Abs(TwoGramCount - other.TwoGramCount) < 0.00001 &&
            ReverseWordList.SequenceEqual(other.ReverseWordList, new KeyValuePairStringIntComparer()) &&
            DataSet.SequenceEqual(other.DataSet));
 }
Esempio n. 2
0
        public static Auger Create(params string[] filenames)
        {
            var d1 = new Dictionary <string, uint>();
            var d2 = new Dictionary <string[], uint>(new StringArrayEqualityComparerTwo());
            var d3 = new Dictionary <string[], uint>(new StringArrayEqualityComparerThree());

            Read(ref d1, ref d2, ref d3, filenames);

            var mkn   = new ModifiedKneserNey(d3, d2, d1);
            var words = d1.Keys.ToArray();

            Array.Sort(words, StringComparer.OrdinalIgnoreCase);
            var sc = new SpellCheck(words, new BoundedJaroWinkler());

            return(new Auger(sc, mkn, mkn));
        }