<commit_before>function GeoSearchResultsListController($scope, $location, $routeParams, $http, $sce, chronontologySettings, $filter) {

    var _this = this;

    _this.loading = false;
    _this.empty = false;

    this.$onChanges = function() {
        this.loadData();
    };

    this.loadData = function() {
        _this.loading = true;
        _this.empty = true;
        $http.get(_this.datasource, {
                headers: { 'Authorization': undefined }
        }).then(function success(geojson){
            _this.loading = false;
            if (geojson.data.geometry) {
                _this.empty = false;
                _this.initPlaces(geojson.data);
            } else if (geojson.data.features) {
                if (geojson.data.features.length > 0) {
                    _this.empty = false;
                    _this.initPlaces(geojson.data);
                }
            } else {
                _this.empty = true;
            }
        }, function error(err) {
            console.warn(err) // TODO show error message
        });
    };

    this.initPlaces = function(geojson) {
        var html = "";
        var mode = "";
        if (geojson.metadata) {
            if (geojson.metadata.searchstring) {
                mode = "q";
            } else {
                mode = "bbox";
            }
        } else {
            mode = "resource";
        }
        if (mode==="q") {
            html += "<p><i>"+geojson.features.length+" Ergebnisse, q="+geojson.metadata.searchstring+"</i></p>";
        } else if (mode==="bbox") {
            html += "<p><i>"+geojson.features.length+" Ergebnisse</i></p>";
        } else if (mode==="resource") {
            html += "<p><i>1 Ergebnisse</i></p>";
        }
        html += "<div class='table-wrapper'>";
        html += "<table class='widget' id='searchresultlist'>";
        html += "<thead>";
        html += "<tr>";
        if (mode==="q") {
            html += "<th>prefName</th>";
            html += "<th data-sort-default>n.lev.</th>";
        } else {
            html += "<th data-sort-default>prefName</th>";
        }
        html += "<th>URL</th>";
        html += "</tr>";
        html += "</thead>";
        html += "<tbody>";
        if (mode==="q" || mode==="bbox") {
            for (var item in geojson.features) {
                html += "<tr>";
                html += "<td >"+geojson.features[item].properties.names.prefName.name+"</td>";
                if (mode==="q") {
                    html += "<td>"+geojson.features[item].properties.similarity.normalizedlevenshtein+"</td>";
                }
                html += "<td><a href='"+geojson.features[item].properties["@id"]+"' target='_blank'>"+geojson.features[item].properties.gazetteertype+":"+geojson.features[item].properties.gazetteerid+"</a></td>";<commit_msg>set onclick for tr in list<commit_after>function GeoSearchResultsListController($scope, $location, $routeParams, $http, $sce, chronontologySettings, $filter) {

    var _this = this;

    _this.loading = false;
    _this.empty = false;

    this.$onChanges = function() {
        this.loadData();
    };

    this.loadData = function() {
        _this.loading = true;
        _this.empty = true;
        $http.get(_this.datasource, {
                headers: { 'Authorization': undefined }
        }).then(function success(geojson){
            _this.loading = false;
            if (geojson.data.geometry) {
                _this.empty = false;
                _this.initPlaces(geojson.data);
            } else if (geojson.data.features) {
                if (geojson.data.features.length > 0) {
                    _this.empty = false;
                    _this.initPlaces(geojson.data);
                }
            } else {
                _this.empty = true;
            }
        }, function error(err) {
            console.warn(err) // TODO show error message
        });
    };

    this.initPlaces = function(geojson) {
        var html = "";
        var mode = "";
        if (geojson.metadata) {
            if (geojson.metadata.searchstring) {
                mode = "q";
            } else {
                mode = "bbox";
            }
        } else {
            mode = "resource";
        }
        if (mode==="q") {
            html += "<p><i>"+geojson.features.length+" Ergebnisse, q="+geojson.metadata.searchstring+"</i></p>";
        } else if (mode==="bbox") {
            html += "<p><i>"+geojson.features.length+" Ergebnisse</i></p>";
        } else if (mode==="resource") {
            html += "<p><i>1 Ergebnisse</i></p>";
        }
        html += "<div class='table-wrapper'>";
        html += "<table class='widget' id='searchresultlist'>";
        html += "<thead>";
        html += "<tr>";
        if (mode==="q") {
            html += "<th>prefName</th>";
            html += "<th data-sort-default>n.lev.</th>";
        } else {
            html += "<th data-sort-default>prefName</th>";
        }
        html += "<th>URL</th>";
        html += "</tr>";
        html += "</thead>";
        html += "<tbody>";
        if (mode==="q" || mode==="bbox") {
            for (var item in geojson.features) {
                html += "<tr onclick=''>";
                html += "<td>"+geojson.features[item].properties.names.prefName.name+"</td>";
                if (mode==="q") {
                    html += "<td>"+geojson.features[item].properties.similarity.normalizedlevenshtein+"</td>";
                }
                html += "<td><a href='"+geojson.features[item].properties["@id"]+"' target='_blank'>"+geojson.features[item].properties.gazetteertype+":"+geojson.features[item].properties.gazetteerid+"</a></td>";
{'fraction_non_alphanumeric': 0.17879161528976573, 'fraction_numerical': 0.0007045974986788797, 'mean_word_length': 1.7324350336862369, 'pattern_counts': {'":': 2, '<': 75, '<?xml version=': 0, '>': 77, 'https://': 0, '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': '5518046', 'n_tokens_mistral': 1701, 'n_tokens_neox': 1644, 'n_words': 290}