<commit_before><?php

if (2 !== $argc) {
    die("Usage: php nb-grabber <agency-name>\n");
}

require_once __DIR__ . '/vendor/autoload.php';

$writer = new nbgrabber\XmlWriter(__DIR__);
$grabber = new nbgrabber\Grabber($writer, $argv[1]);
$grabber->export();<commit_msg>added writer targetting to runner script.<commit_after><?php

$usage = "Usage: php nb-grabber <agency-name>\n [xml|csv-schedule]";

if (3 !== $argc) {
    die($usage);
}

if (! in_array($argv[2], array('xml', 'csv-schedule'))) {
    die($usage);
}


require_once __DIR__ . '/vendor/autoload.php';

// @todo use factory instead
switch ($argv[2]) {
    case 'xml' :
        $writer = new nbgrabber\XmlWriter(__DIR__);
        break;
    case 'csv-schedule' :
        $writer = new nbgrabber\CsvSchedulePrinter(__DIR__);
        break;
    default:
        die($usage);
}

$grabber = new nbgrabber\Grabber($writer, $argv[1]);
$grabber->export();
{'fraction_non_alphanumeric': 0.18640350877192982, 'fraction_numerical': 0.006578947368421052, 'mean_word_length': 3.805263157894737, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '4636950', 'n_tokens_mistral': 348, 'n_tokens_neox': 349, 'n_words': 67}