internal static SpellChecker TryReadFrom(ObjectReader reader)
        {
            try {
                var formatVersion = reader.ReadString();
                if (string.Equals(formatVersion, SerializationFormat, StringComparison.Ordinal))
                {
                    var checksum = Checksum.ReadFrom(reader);
                    var bkTree   = BKTree.ReadFrom(reader);
                    if (bkTree != null)
                    {
                        return(new SpellChecker(checksum, bkTree));
                    }
                }
            } catch {
                Logger.Log(FunctionId.SpellChecker_ExceptionInCacheRead);
            }

            return(null);
        }
Beispiel #2
0
 internal static SpellChecker ReadFrom(ObjectReader reader)
 {
     return(new SpellChecker(BKTree.ReadFrom(reader)));
 }