<commit_before>
class Parser{
  createNode(node){
    let newnode = Object.assign({},node.attribs || {});
    this.parseCoordinate(newnode);
    this.parseTags(node,newnode);
    this.parseOthers(node,newnode);
    return newnode;

  }
  parseCoordinate(newnode){
     var lat = parseFloat(newnode.lat);
     var lng = parseFloat(newnode.lon);
     if(lat && lng){
      newnode.loc={
        type:"Point",
        coordinates:[lng,lat]
      }
      newnode.lng = newnode.lon;
      delete newnode.lon;
     }
  }
  parseTags(node,newnode){
    if(node.children && node.children.tag){
      var tags = node.children.tag;
      let tag;
      newnode.tags = {};
      if(Array.isArray(tags)){
        for(var i=0;i<tags.length;i++){
          tag = tags[i];
          //console.log(tag.attribs.k)
          if(tag.attribs && tag.attribs.k){
            if(tag.attribs.k.trim() === "name"){
              newnode.name = tag.attribs.v.trim();
            }
            else{
              newnode.tags[tag.attribs.k.trim()]=tag.attribs.v.trim();
            }
          }
        }<commit_msg>corrected lat lng format<commit_after>
class Parser{
  createNode(node){
    let newnode = Object.assign({},node.attribs || {});
    this.parseCoordinate(newnode);
    this.parseTags(node,newnode);
    this.parseOthers(node,newnode);
    newnode.id = parseInt(newnode.id);
    return newnode;

  }
  parseCoordinate(newnode){
     var lat = parseFloat(newnode.lat);
     var lng = parseFloat(newnode.lon);
     if(lat && lng){
      newnode.loc={
        type:"Point",
        coordinates:[lng,lat]
      }
      newnode.lat = lat;
      newnode.lng = lng;
      delete newnode.lon;
     }
  }
  parseTags(node,newnode){
    if(node.children && node.children.tag){
      var tags = node.children.tag;
      let tag;
      newnode.tags = {};
      if(Array.isArray(tags)){
        for(var i=0;i<tags.length;i++){
          tag = tags[i];
          //console.log(tag.attribs.k)
          if(tag.attribs && tag.attribs.k){
            if(tag.attribs.k.trim() === "name"){
              newnode.name = tag.attribs.v.trim();
            }
            else{
              newnode.tags[tag.attribs.k.trim()]=tag.attribs.v.trim();
            }
          }
        }
{'fraction_non_alphanumeric': 0.15651400622498887, 'fraction_numerical': 0.0008892841262783459, 'mean_word_length': 1.9920212765957446, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1711079', 'n_tokens_mistral': 801, 'n_tokens_neox': 806, 'n_words': 109}