<commit_before>#!/usr/bin/env ruby
require 'ostruct'
require 'optparse'
require 'rest-client'
require 'json'
require 'csv'
require 'pp'
require 'highline/import'
require 'net/http'


# Standard parameter values

gaz_uri = "https://gazetteer.dainst.org"

template = '{
  "prefName": {
    "title": "#{_[0]}",
    "language": "#{_[1]}",
    "ancient": #{ case _[2]; when \'yes\' then true; else false; end }
  },
  "types": [ "#{_[3]}" ],
  "prefLocation": {
    "coordinates": [ #{_[4].gsub(/,/,\'.\').to_f}, #{_[5].gsub(/,/,\'.\').to_f} ]
  },
  "identifiers": [
    {
      "value": "#{_[6]}",
      "context": "geonames"
    },
    {
      "value": "#{_[7]}",
      "context": "pleiades"
    }
  ],
  "parent": "http://gazetteer.dainst.org/place/#{_[8].empty? ? id(_[9]) : _[8]}"
}'


# option parsing
<commit_msg>updated parent uri in default template of import.rb<commit_after>#!/usr/bin/env ruby
require 'ostruct'
require 'optparse'
require 'rest-client'
require 'json'
require 'csv'
require 'pp'
require 'highline/import'
require 'net/http'


# Standard parameter values

gaz_uri = "https://gazetteer.dainst.org"

template = '{
  "prefName": {
    "title": "#{_[0]}",
    "language": "#{_[1]}",
    "ancient": #{ case _[2]; when \'yes\' then true; else false; end }
  },
  "types": [ "#{_[3]}" ],
  "prefLocation": {
    "coordinates": [ #{_[4].gsub(/,/,\'.\').to_f}, #{_[5].gsub(/,/,\'.\').to_f} ]
  },
  "identifiers": [
    {
      "value": "#{_[6]}",
      "context": "geonames"
    },
    {
      "value": "#{_[7]}",
      "context": "pleiades"
    }
  ],
  "parent": "https://gazetteer.dainst.org/place/#{_[8].empty? ? id(_[9]) : _[8]}"
}'


# option parsing

{'fraction_non_alphanumeric': 0.25912627169359664, 'fraction_numerical': 0.013165769000598444, 'mean_word_length': 3.1904761904761907, 'pattern_counts': {'":': 26, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '5801433', 'n_tokens_mistral': 678, 'n_tokens_neox': 661, 'n_words': 127}