Example #1
0
 private void Worker_DoWork(object sender, DoWorkEventArgs e)
 {
     string baseDir = AppDomain.CurrentDomain.BaseDirectory;
     var lines = File.ReadAllLines(string.Format("{0}{1}", baseDir, Properties.Settings.Default.OCRTestFilePath));
     var p = new OCRProcessor(_worker);
     p.ProcessOCRFile(lines);
 }
        public KataBankOCRTest()
        {
            Processor = new OCRProcessor();

            GoodLines = new string[]
            {
                " _  _  _  _  _  _  _  _  _ " + Environment.NewLine,
                "| || || || || || || || || |" + Environment.NewLine,
                "|_||_||_||_||_||_||_||_||_|" + Environment.NewLine,
                "                           " + Environment.NewLine,
                "                           " + Environment.NewLine,
                "  |  |  |  |  |  |  |  |  |" + Environment.NewLine,
                "  |  |  |  |  |  |  |  |  |" + Environment.NewLine,
                "                           " + Environment.NewLine,
                " _  _  _  _  _  _  _  _  _ " + Environment.NewLine,
                " _| _| _| _| _| _| _| _| _|" + Environment.NewLine,
                "|_ |_ |_ |_ |_ |_ |_ |_ |_ " + Environment.NewLine,
                "                           " + Environment.NewLine,
                " _  _  _  _  _  _  _  _  _ " + Environment.NewLine,
                " _| _| _| _| _| _| _| _| _|" + Environment.NewLine,
                " _| _| _| _| _| _| _| _| _|" + Environment.NewLine,
                "                           " + Environment.NewLine,
                "                           " + Environment.NewLine,
                "|_||_||_||_||_||_||_||_||_|" + Environment.NewLine,
                "  |  |  |  |  |  |  |  |  |" + Environment.NewLine,
                "                           " + Environment.NewLine,
                " _  _  _  _  _  _  _  _  _ " + Environment.NewLine,
                "|_ |_ |_ |_ |_ |_ |_ |_ |_ " + Environment.NewLine,
                " _| _| _| _| _| _| _| _| _|" + Environment.NewLine,
                "                           " + Environment.NewLine,
                " _  _  _  _  _  _  _  _  _ " + Environment.NewLine,
                "|_ |_ |_ |_ |_ |_ |_ |_ |_ " + Environment.NewLine,
                "|_||_||_||_||_||_||_||_||_|" + Environment.NewLine,
                "                           " + Environment.NewLine,
                " _  _  _  _  _  _  _  _  _ " + Environment.NewLine,
                "  |  |  |  |  |  |  |  |  |" + Environment.NewLine,
                "  |  |  |  |  |  |  |  |  |" + Environment.NewLine,
                "                           " + Environment.NewLine,
                " _  _  _  _  _  _  _  _  _ " + Environment.NewLine,
                "|_||_||_||_||_||_||_||_||_|" + Environment.NewLine,
                "|_||_||_||_||_||_||_||_||_|" + Environment.NewLine,
                "                           " + Environment.NewLine,
                " _  _  _  _  _  _  _  _  _ " + Environment.NewLine,
                "|_||_||_||_||_||_||_||_||_|" + Environment.NewLine,
                " _| _| _| _| _| _| _| _| _|" + Environment.NewLine,
                "                           " + Environment.NewLine
            };

            BadLines = new string[]
            {
                "abcdefghijklmnopqrstjkjgjuvwxyz" + Environment.NewLine,
                "abcdefghijklmnostuvwxyz" + Environment.NewLine,
                "abcdefghijklmnopqrswxyz" + Environment.NewLine,
                "abcdefghijklmnopfggfqrstuvwxyz" + Environment.NewLine
            };

            MixedLines = new string[]
            {
                "abcdefghijklmnopqrstuvwxyz1" + Environment.NewLine,
                "sdfgb" + Environment.NewLine,
                "abcdefghijklmnopqrstuvwdfgdfxyz" + Environment.NewLine
            };

            BadCharacterLines = new string[]
            {
                "    _  _  _  _  _  _  _  _ " + Environment.NewLine,
                "|_||_||_||_| _||_||_|  ||_|" + Environment.NewLine,
                "|_||_||_||_||_||_||_||_ |_|" + Environment.NewLine,
                "                           " + Environment.NewLine
            };

            Processor.Lines = GoodLines;
        }