Exemple #1
0
        public double CalculatePercentChanged()
        {
            string page1 = _cache;
            string page2 = Helpers.WebHelper.DownloadWebPage(_url);
            if (page2 == "")
            {
                Error();
                return -1.0;
            }

            diff_match_patch difflib = new diff_match_patch();
            List<Diff> list = difflib.diff_main(page1, page2);

            double levenshtein = difflib.diff_levenshtein(list);
            double length = (page1.Length > page2.Length) ? page1.Length : page2.Length;

            double percentDifferent = levenshtein / length * 100;

            return percentDifferent;
        }