コード例 #1
0
ファイル: Program.cs プロジェクト: jeremyrsellars/recipe
        static void MainFiles(string[] args)
        {
            var f0 = System.IO.File.ReadAllText(args [0]);
            var f1 = System.IO.File.ReadAllText(args [1]);

            var sequence = new Sellars.Analysis.SimpleSequenceComparer <char> ().CompareSequences(f0, f1);

            WriteSequence(sequence, ConsoleColor.Cyan, ConsoleColor.Green);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: jeremyrsellars/recipe
        static void Main2(string[] args)
        {
            TestBitArrayND();
            Dictionary <string, string> dict = new Dictionary <string, string> ();

            dict.Add("jeremy is cool", "Jeremy is the coolest!");

            dict.Add(
                @"jeremy is coolabcdefghijklmnopqrstuvwxyz",
                @"Jeremy is 
abcdefghijklmnopqrstuvwxyz
the coolest!");


            dict.Add(
                "         for (int i = 0; i < dimensions [0]; i++)",
                "               for (int k = 0; k < dimensions [2]; k++)");

            //foreach (var sample in dict)
            //foreach (var x in new Sellars.Analysis.SimpleSequenceComparer<char> ().CompareSequences(sample.Key,sample.Value))
            //{
            //   Write (x);
            //}
            foreach (var sample in dict)
            {
                Console.WriteLine("---------------------------------------------------------");
                Console.WriteLine("Differences between these strings:\r\n1.  {0}\r\n2.  {1}", sample.Key, sample.Value);
                var sequence = new Sellars.Analysis.SimpleSequenceComparer <char> ().CompareSequences(sample.Key, sample.Value).ToList();
                WriteSequence(sequence, Sellars.Analysis.ComparisonResult.Left, true, ConsoleColor.Cyan);
                Console.WriteLine();
                WriteSequence(sequence, Sellars.Analysis.ComparisonResult.Right, true, ConsoleColor.Green);
                Console.WriteLine();
            }

            Console.WriteLine("Press enter");
            Console.ReadLine();
        }