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); }
internal static SpellChecker ReadFrom(ObjectReader reader) { return(new SpellChecker(BKTree.ReadFrom(reader))); }