<commit_before><!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>LTDL3 Client</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

        <!-- build:css styles/main.css -->
        <link rel="stylesheet" href="styles/main.css">
        <!-- endbuild-->

        <!-- Place your HTML imports here -->
        <script src="bower_components/jquery/dist/jquery.min.js"></script>
        <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    </head>
    <body>
                    <a href="https://github.com/Trott/ltdl3-client"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
        <div class="container">
            <div class="jumbotron">
                <h4>LTDL3 Search Builder Prototype</h4>
                <form role="form">
                    <div id="ltdl-search-builder"></div>
                    <div class="pull-right">
                        <button type="submit" class="btn btn-default">Search <span class="glyphicon glyphicon-search"></span></button>
                    </div>
                </form>
            </div>
        </div>
        <div id="footer">
            <div class="container text-muted text-center small">
                <p>&copy; 2014 Regents of the University of California</p>
                <p><a href="http://glyphicons.com/">Glyphicons</a> are used on this page.</p>
            </div>
        </div>
        <script>
            // TODO: Inline script. No no no no no. (Well, yes yes yes after a build process perhaps.)
            var focusSearchBox = function () {
                $(this).parents('.ltdl-search-builder-component').find('.ltdl-search-box').focus();
            }

            var filterWhatCallback = function () {
                var text = $(this).attr('data-ltdl-text');
                if (typeof text !== "string") {
                    text = $(this).text();
                }
                $(this).parents('.ltdl-search-builder-component').find('button.ltdl-filter-what').html(text + ' <span class="caret"></span>');
                focusSearchBox.apply(this);
            };

            var filterWhatToSearchBoxCallback = function () {
                $(this).parents('.ltdl-search-builder-component').find('.ltdl-search-box').val($(this).text());
                // TODO: parent().parent().parent()? We can do better than that.
                $(this).parents('.ltdl-search-builder-component').find('button.ltdl-filter-what').html($(this).parent().parent().parent().find('.hoist-to-button').text() + ' <span class="caret"></span>');
                focusSearchBox.apply(this);
            }

            var filterPhraseCallback = function () {
                $(this).parents('.ltdl-search-builder-component').find('.ltdl-filter-phrase').html($(this).text() + ' <span class="caret"></span>');
                focusSearchBox.apply(this);
            };

            // TODO: Big long DOM string, no no no.
            // TODO: classes sometimes prepended with ltdl- but not always. Make it always.
            var addSearchBuilderComponent = function () {
                var newSearchBuilderComponent = $('<div class="form-group ltdl-search-builder-component">' +
                    '<div class="input-group">' +
                        '<div class="input-group-btn">' +
                            '<button type="button" class="btn btn-default dropdown-toggle ltdl-filter-what" data-toggle="dropdown">' +
                                'Everywhere <span class="caret"></span>' +
                            '</button>' +
                            '<ul class="dropdown-menu ltdl-filter-what" role="menu">' +
                                '<li><a class="show-in-button" href="#">Everywhere</a></li>' +
                                '<li><a class="show-in-button" href="#">Title</a></li>' +
                                '<li><a class="show-in-button" href="#">Person</a></li>' +
                                '<li><a class="show-in-button" href="#">Organization</a></li>' +
                                '<li class="dropdown-submenu">' +
                                    '<a class="hoist-to-button" href="#">Type</a>' +
                                    '<ul class="dropdown-menu ltdl-filter-what-phrase">' +
                                        '<li><a class="show-in-search-box" href="#">Letter</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Email</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Report</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Ad</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Video</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Memo</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Newsletter</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Journal</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Invoice</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Financial</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Agenda</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Form</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Article</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Audio</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Graphics</a></li>' +
                                        '<li><a class="show-in-button" data-ltdl-text="Type" href="#">Other</a></li>' +
                                    '</ul>' +
                                '</li>' +
                                '<li class="dropdown-submenu">' +
                                    '<a class="hoist-to-button" href="#">Brand Name</a>' +
                                    '<ul class="dropdown-menu ltdl-filter-what-phrase">' +
                                        '<li><a class="show-in-search-box" href="#">Camel</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Marlboro</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Virginia Slims</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Skoal</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Garcia Y Vega</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">More</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Winston</a></li>' +
                                        '<li><a class="show-in-button" data-ltdl-text="Brand Name" href="#">Other</a></li>' +
                                    '</ul>' +
                                '</li>' +
                                '<li><a class="show-in-button" href="#">Bates Number</a></li>' +
                                '<li><a class="show-in-button" href="#">ID Number</a></li>' +
                                '<li class="divider"></li>' +
                                '<li class="dropdown-submenu">' +
                                    '<a href="#">More</a>' +
                                    '<ul class="dropdown-menu">' +
                                        '<li><a class="show-in-button" href="#">Text</a></li>' +
                                        '<li><a class="show-in-button" href="#">Metadata</a></li>' +
                                        '<li><a class="show-in-button" href="#">Keyword</a></li>' +
                                        '<li><a class="show-in-button" href="#">Notes</a></li>' +
                                    '</ul>' +
                                '</li>' +
                            '</ul>' +
                        '</div>' +
                        '<div class="input-group-btn">' +
                            '<button type="button" class="btn btn-default dropdown-toggle ltdl-filter-phrase" data-toggle="dropdown">' +
                                'for any of the words <span class="caret"></span>' +
                            '</button>' +
                            '<ul class="dropdown-menu" role="menu">' +
                                '<li><a class="show-in-phrase-button" href="#">for any of the words</a></li>' +
                                '<li><a class="show-in-phrase-button" href="#">for all of the words</a></li>' +
                                '<li><a class="show-in-phrase-button" href="#">for the exact phrase</a></li>' +
                            '</ul>' +
                        '</div>' +
                        '<input class="form-control ltdl-search-box" type="text" placeholder="Tip: use (*) or (?) to find word variants like legislat* and wom?n">' +
                        '<div class="input-group-btn">' +
                            '<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-plus"></span></button>' +
                            '<ul class="dropdown-menu dropdown-menu-right" role="menu">' +
                                '<li><a class="ltdl-search-add" href="#">AND</a></li>' +
                                '<li><a class="ltdl-search-add" href="#">OR</a></li>' +
                                '<li><a class="ltdl-search-add" href="#">NOT</a></li>' +
                            '</ul>' +
                        '</div>' +
                    '</div>' +
                '</div>');

                $(newSearchBuilderComponent).find('.show-in-button').on('click', filterWhatCallback);
                $(newSearchBuilderComponent).find('.show-in-search-box').on('click', filterWhatToSearchBoxCallback);
                $(newSearchBuilderComponent).find('.show-in-phrase-button').on('click', filterPhraseCallback);

                $(newSearchBuilderComponent).find('.ltdl-search-add').on('click', addSearchBuilderComponent);

                $('#ltdl-search-builder').append(newSearchBuilderComponent);
                $('#ltdl-search-builder input').focus();
            };

            $('document').ready(addSearchBuilderComponent);

            // TODO: +/-, AND/OR/NOT
        </script>
    </body>
</html><commit_msg>+ -> -<commit_after><!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>LTDL3 Client</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

        <!-- build:css styles/main.css -->
        <link rel="stylesheet" href="styles/main.css">
        <!-- endbuild-->

        <!-- Place your HTML imports here -->
        <script src="bower_components/jquery/dist/jquery.min.js"></script>
        <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    </head>
    <body>
                    <a href="https://github.com/Trott/ltdl3-client"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
        <div class="container">
            <div class="jumbotron">
                <h4>LTDL3 Search Builder Prototype</h4>
                <form role="form">
                    <div id="ltdl-search-builder"></div>
                    <div class="pull-right">
                        <button type="submit" class="btn btn-default">Search <span class="glyphicon glyphicon-search"></span></button>
                    </div>
                </form>
            </div>
        </div>
        <div id="footer">
            <div class="container text-muted text-center small">
                <p>&copy; 2014 Regents of the University of California</p>
                <p><a href="http://glyphicons.com/">Glyphicons</a> are used on this page.</p>
            </div>
        </div>
        <script>
            // TODO: Inline script. No no no no no. (Well, yes yes yes after a build process perhaps.)
            var focusSearchBox = function () {
                $(this).parents('.ltdl-search-builder-component').find('.ltdl-search-box').focus();
            }

            var filterWhatCallback = function () {
                var text = $(this).attr('data-ltdl-text');
                if (typeof text !== "string") {
                    text = $(this).text();
                }
                $(this).parents('.ltdl-search-builder-component').find('button.ltdl-filter-what').html(text + ' <span class="caret"></span>');
                focusSearchBox.apply(this);
            };

            var filterWhatToSearchBoxCallback = function () {
                $(this).parents('.ltdl-search-builder-component').find('.ltdl-search-box').val($(this).text());
                // TODO: parent().parent().parent()? We can do better than that.
                $(this).parents('.ltdl-search-builder-component').find('button.ltdl-filter-what').html($(this).parent().parent().parent().find('.hoist-to-button').text() + ' <span class="caret"></span>');
                focusSearchBox.apply(this);
            }

            var filterPhraseCallback = function () {
                $(this).parents('.ltdl-search-builder-component').find('.ltdl-filter-phrase').html($(this).text() + ' <span class="caret"></span>');
                focusSearchBox.apply(this);
            };

            // TODO: Big long DOM string, no no no.
            // TODO: classes sometimes prepended with ltdl- but not always. Make it always.
            var addSearchBuilderComponent = function (event) {
                if (event.type === "click") {
                    $(this).parents('.ltdl-search-builder-component').find('.ltdl-search-plus').html(
                        '<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-minus"></span></button>'
                    );
                }
                var newSearchBuilderComponent = $('<div class="form-group ltdl-search-builder-component">' +
                    '<div class="input-group">' +
                        '<div class="input-group-btn">' +
                            '<button type="button" class="btn btn-default dropdown-toggle ltdl-filter-what" data-toggle="dropdown">' +
                                'Everywhere <span class="caret"></span>' +
                            '</button>' +
                            '<ul class="dropdown-menu ltdl-filter-what" role="menu">' +
                                '<li><a class="show-in-button" href="#">Everywhere</a></li>' +
                                '<li><a class="show-in-button" href="#">Title</a></li>' +
                                '<li><a class="show-in-button" href="#">Person</a></li>' +
                                '<li><a class="show-in-button" href="#">Organization</a></li>' +
                                '<li class="dropdown-submenu">' +
                                    '<a class="hoist-to-button" href="#">Type</a>' +
                                    '<ul class="dropdown-menu ltdl-filter-what-phrase">' +
                                        '<li><a class="show-in-search-box" href="#">Letter</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Email</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Report</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Ad</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Video</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Memo</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Newsletter</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Journal</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Invoice</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Financial</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Agenda</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Form</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Article</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Audio</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Graphics</a></li>' +
                                        '<li><a class="show-in-button" data-ltdl-text="Type" href="#">Other</a></li>' +
                                    '</ul>' +
                                '</li>' +
                                '<li class="dropdown-submenu">' +
                                    '<a class="hoist-to-button" href="#">Brand Name</a>' +
                                    '<ul class="dropdown-menu ltdl-filter-what-phrase">' +
                                        '<li><a class="show-in-search-box" href="#">Camel</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Marlboro</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Virginia Slims</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Skoal</a></li>' +
                                        '<li><a class="show-in-search-box" href="#"><NAME></a></li>' +
                                        '<li><a class="show-in-search-box" href="#">More</a></li>' +
                                        '<li><a class="show-in-search-box" href="#">Winston</a></li>' +
                                        '<li><a class="show-in-button" data-ltdl-text="Brand Name" href="#">Other</a></li>' +
                                    '</ul>' +
                                '</li>' +
                                '<li><a class="show-in-button" href="#">Bates Number</a></li>' +
                                '<li><a class="show-in-button" href="#">ID Number</a></li>' +
                                '<li class="divider"></li>' +
                                '<li class="dropdown-submenu">' +
                                    '<a href="#">More</a>' +
                                    '<ul class="dropdown-menu">' +
                                        '<li><a class="show-in-button" href="#">Text</a></li>' +
                                        '<li><a class="show-in-button" href="#">Metadata</a></li>' +
                                        '<li><a class="show-in-button" href="#">Keyword</a></li>' +
                                        '<li><a class="show-in-button" href="#">Notes</a></li>' +
                                    '</ul>' +
                                '</li>' +
                            '</ul>' +
                        '</div>' +
                        '<div class="input-group-btn">' +
                            '<button type="button" class="btn btn-default dropdown-toggle ltdl-filter-phrase" data-toggle="dropdown">' +
                                'for any of the words <span class="caret"></span>' +
                            '</button>' +
                            '<ul class="dropdown-menu" role="menu">' +
                                '<li><a class="show-in-phrase-button" href="#">for any of the words</a></li>' +
                                '<li><a class="show-in-phrase-button" href="#">for all of the words</a></li>' +
                                '<li><a class="show-in-phrase-button" href="#">for the exact phrase</a></li>' +
                            '</ul>' +
                        '</div>' +
                        '<input class="form-control ltdl-search-box" type="text" placeholder="Tip: use (*) or (?) to find word variants like legislat* and wom?n">' +
                        '<div class="input-group-btn ltdl-search-plus">' +
                            '<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-plus"></span></button>' +
                            '<ul class="dropdown-menu dropdown-menu-right" role="menu">' +
                                '<li><a class="ltdl-search-add" href="#">AND</a></li>' +
                                '<li><a class="ltdl-search-add" href="#">OR</a></li>' +
                                '<li><a class="ltdl-search-add" href="#">NOT</a></li>' +
                            '</ul>' +
                        '</div>' +
                    '</div>' +
                '</div>');

                $(newSearchBuilderComponent).find('.show-in-button').on('click', filterWhatCallback);
                $(newSearchBuilderComponent).find('.show-in-search-box').on('click', filterWhatToSearchBoxCallback);
                $(newSearchBuilderComponent).find('.show-in-phrase-button').on('click', filterPhraseCallback);

                $(newSearchBuilderComponent).find('.ltdl-search-add').on('click', addSearchBuilderComponent);

                $('#ltdl-search-builder').append(newSearchBuilderComponent);
                $('#ltdl-search-builder input').focus();
            };

            $('document').ready(addSearchBuilderComponent);

            // TODO: +/-, AND/OR/NOT
        </script>
    </body>
</html>
{'fraction_non_alphanumeric': 0.18325971731448762, 'fraction_numerical': 0.013780918727915195, 'mean_word_length': 1.4217563375762114, 'pattern_counts': {'":': 0, '<': 542, '<?xml version=': 0, '>': 543, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 80, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '861990', 'n_tokens_mistral': 6217, 'n_tokens_neox': 5892, 'n_words': 924}