<commit_before><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <form>
            <input type="text" name="testvalue" id="testvalue">
            <button type="submit">
                test
            </button>
        </form>
        <button id="starttest">
            Test all
        </button>
        (Open console) <br>
        <canvas id="canvas"></canvas>

        <script src="https://cdn.jsdelivr.net/jquery/3.0.0-beta1/jquery.min.js"></script>
        <script src="js/verb.js"></script>
        <script src="js/characterfinder.js"></script>
        <script>

        var finder;
        var currentImgIndex = 0;
        var successes = 0;
        var imgArray = [];
        var totalImages = 0;

        window.onload = function(){
            finder = new CharacterFinder( $( "#canvas" ).get( 0 ), 145, 70 );

            finder.onComplete(function( file, result ){
                var firstDot = file.indexOf( '.' );
                var firstDash = file.indexOf( '-' );
                var fileMatch;

                if( firstDot > -1 && firstDash > -1 ){
                    if( firstDot < firstDash ){
                        fileMatch = file.substr( 0, firstDot );
                    } else {
                        fileMatch = file.substr( 0, firstDash );
                    }
                } else if( firstDot > -1 ){
                    fileMatch = file.substr( 0, firstDot );
                } else if( firstDash > -1 ){
                    fileMatch = file.substr( 0, firstDash );
                }

                if( Number( fileMatch ) === result ){
                    successes = successes + 1;
                    console.log( ( currentImgIndex + 1 ) + '/' + totalImages + ' %c' + file + ' | ' + result, 'color: #1bc91b' );
                } else {
                    console.log( ( currentImgIndex + 1 ) + '/' + totalImages + ' %c' + file + ' | ' + result, 'color: #c21414' );
                }

                $("body").append($( "#canvas" ).clone( ));
                doNext();
            });

            $("form").on('submit', function( event ){
                event.preventDefault();

                var name = $("#testvalue").val();
                totalImages = 1;
                currentImgIndex = 0;
                successes = 0;
                finder.setImg('img/' + name + '.jpg');
                imgArray = false;
            });

            $("#starttest").on( 'click', function(){
                $.getJSON('img/files.php', function(data){
                    totalImages = data.length;
                    currentImgIndex = 0;
                    successes = 0;
<commit_msg>Make a differentiation between matching a zero and not matching at all<commit_after><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <form>
            <input type="text" name="testvalue" id="testvalue">
            <button type="submit">
                test
            </button>
        </form>
        <button id="starttest">
            Test all
        </button>
        (Open console) <br>
        <canvas id="canvas"></canvas>

        <script src="https://cdn.jsdelivr.net/jquery/3.0.0-beta1/jquery.min.js"></script>
        <script src="js/verb.js"></script>
        <script src="js/characterfinder.js"></script>
        <script>

        var finder;
        var currentImgIndex = 0;
        var successes = 0;
        var imgArray = [];
        var totalImages = 0;

        window.onload = function(){
            finder = new CharacterFinder( $( "#canvas" ).get( 0 ), 145, 70 );

            finder.onComplete(function( file, result ){
                var firstDot = file.indexOf( '.' );
                var firstDash = file.indexOf( '-' );
                var fileMatch;

                if( firstDot > -1 && firstDash > -1 ){
                    if( firstDot < firstDash ){
                        fileMatch = file.substr( 0, firstDot );
                    } else {
                        fileMatch = file.substr( 0, firstDash );
                    }
                } else if( firstDot > -1 ){
                    fileMatch = file.substr( 0, firstDot );
                } else if( firstDash > -1 ){
                    fileMatch = file.substr( 0, firstDash );
                }

                if( Number( fileMatch ) === 0 ){
                    if( false === result ){
                        successes = successes + 1;
                        console.log( ( currentImgIndex + 1 ) + '/' + totalImages + ' %c' + file + ' | ' + result, 'color: #1bc91b' );
                    } else {
                        console.log( ( currentImgIndex + 1 ) + '/' + totalImages + ' %c' + file + ' | ' + result, 'color: #c21414' );
                    }
                } else {
                    if( Number( fileMatch ) === result ){
                        successes = successes + 1;
                        console.log( ( currentImgIndex + 1 ) + '/' + totalImages + ' %c' + file + ' | ' + result, 'color: #1bc91b' );
                    } else {
                        console.log( ( currentImgIndex + 1 ) + '/' + totalImages + ' %c' + file + ' | ' + result, 'color: #c21414' );
                    }
                }

                $("body").append($( "#canvas" ).clone( ));
                doNext();
            });

            $("form").on('submit', function( event ){
                event.preventDefault();

                var name = $("#testvalue").val();
                totalImages = 1;
                currentImgIndex = 0;
                successes = 0;
                finder.setImg('img/' + name + '.jpg');
                imgArray = false;
            });

            $("#starttest").on( 'click', function(){
                $.getJSON('img/files.php', function(data){
                    totalImages = data.length;
                    currentImgIndex = 0;
                    successes = 0;

{'fraction_non_alphanumeric': 0.14452408734789132, 'fraction_numerical': 0.014669111518586431, 'mean_word_length': 1.2230455724342348, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 61, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5639856', 'n_tokens_mistral': 1727, 'n_tokens_neox': 1555, 'n_words': 365}