<commit_before>#!/usr/bin/env python

# TODO
# Gatewayliste
# aliases.json

import json
import fileinput
import argparse

from nodedb import NodeDB
from geomapbuilder import GeoMapBuilder

parser = argparse.ArgumentParser()

parser.add_argument('-a', '--aliases',
                  help='read aliases from FILE',
                  metavar='FILE')

parser.add_argument('batmanjson', help='output of batman vd json')

args = parser.parse_args()

options = vars(args)

db = NodeDB()

db.import_batman(list(fileinput.input(options['batmanjson'])))

if options['aliases']:
  db.import_aliases(json.load(open(options['aliases'])))

db.import_wikigps("http://freifunk.metameute.de/Knoten")

#db.wilder_scheiss()

m = GeoMapBuilder(db)

print(m.build())<commit_msg>encode kml using utf8<commit_after>#!/usr/bin/env python

# TODO
# Gatewayliste
# aliases.json

import json
import fileinput
import argparse

from nodedb import NodeDB
from geomapbuilder import GeoMapBuilder

parser = argparse.ArgumentParser()

parser.add_argument('-a', '--aliases',
                  help='read aliases from FILE',
                  metavar='FILE')

parser.add_argument('batmanjson', help='output of batman vd json')

args = parser.parse_args()

options = vars(args)

db = NodeDB()

db.import_batman(list(fileinput.input(options['batmanjson'])))

if options['aliases']:
  db.import_aliases(json.load(open(options['aliases'])))

db.import_wikigps("http://freifunk.metameute.de/Knoten")

#db.wilder_scheiss()

m = GeoMapBuilder(db)

print(m.build().encode("utf8"))
{'fraction_non_alphanumeric': 0.14118412491867274, 'fraction_numerical': 0.0013012361743656475, 'mean_word_length': 4.717472118959108, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6290866', 'n_tokens_mistral': 547, 'n_tokens_neox': 530, 'n_words': 100}