<commit_before><!DOCTYPE html>
<html>
    <head>
        <title>Search Module</title>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
    </head>
    <body>
        <h1>Search Module</h1>
        
        <div id='myMap' style='width: 600px; height: 400px;'></div>
        <script type='text/javascript'>
            function loadMap() {
                var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
                    // Do NOT use these credentials, replace with your own Bing Maps Key
                    credentials: '<KEY>'
                });
                
                // load the Search module
                Microsoft.Maps.loadModule('Microsoft.Maps.Search', function() {

                    // create SearchManager to do search
                    var manager = new Microsoft.Maps.Search.SearchManager(map);
                    
                    // create request options for search
                    var options = new Microsoft.Maps.Search.GeocodeRequestOptions();
                    
                    // set an Address to search for
                    options.where = '1 Infinite Loop, Palo Alto, CA';
                    
                    options.callback = function (answer, data) {
                        // set the best view to show the first search result
                        map.setView({
                            bounds: answer.results[0].bestView
                        });
                        
                        // create pushpin for first search result
                        var pin = new Microsoft.Maps.Pushpin(answer.results[0].location);
                        
                        // plot the pushpin on the map
                        map.entities.push(pin);
                    };
                    
                    // Call geocode to perform the search
                    manager.geocode(options);
                });
            }
        </script>
        <script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?callback=loadMap' async defer></script>
        
        <hr/>
        <a href="https://github.com/crpietschmann/bingmaps-v8-quickstart-samples/blob/master/201-module-search/index.htm">View Full Source Code</a>
        &nbsp;|&nbsp;Bing Maps v8 Quickstart Samples project
    </body>
</html><commit_msg>enhanced search example<commit_after><!DOCTYPE html>
<html>
    <head>
        <title>Search Module</title>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
    </head>
    <body>
        <h1>Search Module</h1>

        <input type="text" id="txtSearch" value="1 Infinite Loop, Palo Alto, CA"/> <button type="button" id="btnSearch">Search</button><br/>
        <strong>Latitude: </strong><span id="txtLat"></span><br/>
        <strong>Longitude: </strong><span id="txtLng"></span>
        
        <div id='myMap' style='width: 600px; height: 400px;'></div>
        <script type='text/javascript'>
            function loadMap() {
                var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
                    // Do NOT use these credentials, replace with your own Bing Maps Key
                    credentials: '<KEY>'
                });
                

                function doSearch() {
                    var searchQuery = $('#txtSearch').val();
                    
                    // load the Search module
                    Microsoft.Maps.loadModule('Microsoft.Maps.Search', function() {
                    
                        // create SearchManager to do search
                        var manager = new Microsoft.Maps.Search.SearchManager(map);
                        
                        // create request options for search
                        var options = new Microsoft.Maps.Search.GeocodeRequestOptions();
                        
                        // set an Address to search for
                        options.where = searchQuery;
                        
                        options.callback = function (answer, data) {
                            // set the best view to show the first search result
                            map.setView({
                                bounds: answer.results[0].bestView
                            });
                            
                            // create pushpin for first search result
                            var pin = new Microsoft.Maps.Pushpin(answer.results[0].location);

                            $('#txtLat').text(answer.results[0].location.latitude);
                            $('#txtLng').text(answer.results[0].location.longitude);                        


                            // plot the pushpin on the map
                            map.entities.push(pin);
                        };
                        
                        // Call geocode to perform the search
                        manager.geocode(options);
                    });
                }


                $('#btnSearch').click(function(){
                    doSearch();
                });
                $('#txtSearch').keypress(function(e) {
                    if(e.which == 13) {
                        doSearch();
                    }
                });

                doSearch();
            }
        </script>
        <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
        <script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?callback=loadMap' async defer></script>
        
        <hr/>
        <a href="https://github.com/crpietschmann/bingmaps-v8-quickstart-samples/blob/master/201-module-search/index.htm">View Full Source Code</a>
        &nbsp;|&nbsp;Bing Maps v8 Quickstart Samples project
    </body>
</html>
{'fraction_non_alphanumeric': 0.11021735409892179, 'fraction_numerical': 0.007188088310799247, 'mean_word_length': 1.2212086659064993, 'pattern_counts': {'":': 0, '<': 62, '<?xml version=': 0, '>': 62, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2821670', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1343, 'n_words': 311}