<commit_before>﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BankOCRLib;

namespace BankOCRTests {
    [TestClass]
    public class ParserTests {
        [TestMethod]
        public void ParserNumber_ShouldParseZero() {
            //var toParse =
            //        " _     _  _     _  _  _  _  _ " +
            //        "| |  | _| _||_||_ |_   ||_||_|" +
            //        "|_|  ||_  _|  | _||_|  ||_| _|" +
            //        "                              ";
            var zero = String.Join("\n",
                " _ ",
                "| |",
                "|_|",
                "   ");

            var parser = new Parser();
            var result = parser.ParseNumber(zero);
            Assert.AreEqual(0, result);
        }

        [TestMethod]
        public void ParserNumber_ShouldParseOne() {
            var one = String.Join("\n",
                "   ",
                "  |",
                "  |",
                "   ");

            var parser = new Parser();
            var result = parser.ParseNumber(one);
            Assert.AreEqual(1, result);
        }

        [TestMethod]
        public void ParseNumber_ShouldParseTwo() {
            var two = String.Join("\n",
                " _ ",
                " _|",
                "|_ ",
                "   ");

            var parser = new Parser();
            var result = parser.ParseNumber(two);
            Assert.AreEqual(2, result);
        }

        [TestMethod]
        public void GetNumberAtIndex() {
            var input = String.Join("\n",
                " _     _  _     _  _  _  _  _ ",
                "| |  | _| _||_||_ |_   ||_||_|",
                "|_|  ||_  _|  | _||_|  ||_| _|",
                "                              ");

            var parser = new Parser();
            var result = parser.GetNumberAtIndex(input, 0);

            var zero = String.Join("\n",
                " _ ",
                "| |",
                "|_|",
                "   ");
            Assert.AreEqual(zero, result);

            result = parser.GetNumberAtIndex(input, 1);
            var one = String.Join("\n",
                "   ",
                "  |",
                "  |",
                "   ");
            Assert.AreEqual(one, result);<commit_msg>Forgot to add the test changes to the previous commit.<commit_after>﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BankOCRLib;

namespace BankOCRTests {
    [TestClass]
    public class ParserTests {
        [TestMethod]
        public void Parse_AccountLengthInput() {
            var input = String.Join("\n",
                " _     _  _     _  _  _  _  _ ",
                "| |  | _| _||_||_ |_   ||_||_|",
                "|_|  ||_  _|  | _||_|  ||_| _|",
                "                              ");

            var result = new OcrNumberParser().Parse(input);
            Assert.AreEqual("0123456789", result);
{'fraction_non_alphanumeric': 0.1346675712347354, 'fraction_numerical': 0.00508819538670285, 'mean_word_length': 1.0607966457023061, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1999587', 'n_tokens_mistral': 879, 'n_tokens_neox': 814, 'n_words': 123}