<commit_before>// https://stackoverflow.com/questions/343865/how-to-convert-from-utm-to-latlng-in-python-or-javascript

module.exports =
    {
        doConvert: function(data)
        {
            return convert(data);
        }
    };

function convert(data)
{
    const json  = JSON.parse(data);

    const converted    = {};
    converted.type     = "FeatureCollection";
    converted.features = [];

    for (i = 1; i < json.length; i++)
    {
        const itemJSON = json[i];

        var feature    = {};
        var geometry   = {};
        var properties = {};

        feature.type         = "Feature";
        feature.geometry     = geometry;
        feature.properties   = properties;

        geometry.type        = "Point";
        geometry.coordinates =
            [
                Number(itemJSON.longitude),
                Number(itemJSON.latitude)
            ];

        properties.name = itemJSON.title;

        if(itemJSON.description !== null)
        {
            properties.summary = itemJSON.description;
        }<commit_msg>some items don't have names, names are required.<commit_after>// https://stackoverflow.com/questions/343865/how-to-convert-from-utm-to-latlng-in-python-or-javascript

module.exports =
    {
        doConvert: function(data)
        {
            return convert(data);
        }
    };

function convert(data)
{
    const json  = JSON.parse(data);

    const converted    = {};
    converted.type     = "FeatureCollection";
    converted.features = [];

    for (i = 1; i < json.length; i++)
    {
        const itemJSON = json[i];

        var feature    = {};
        var geometry   = {};
        var properties = {};

        feature.type         = "Feature";
        feature.geometry     = geometry;
        feature.properties   = properties;

        geometry.type        = "Point";
        geometry.coordinates =
            [
                Number(itemJSON.longitude),
                Number(itemJSON.latitude)
            ];

        if(itemJSON.title === null)
        {
            continue;
        }

        properties.name = itemJSON.title;

        if(itemJSON.description !== null)
        {
            properties.summary = itemJSON.description;
        }
{'fraction_non_alphanumeric': 0.11928251121076233, 'fraction_numerical': 0.006278026905829596, 'mean_word_length': 1.615474794841735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3631022', 'n_tokens_mistral': 631, 'n_tokens_neox': 603, 'n_words': 108}