<commit_before><?php

/**
 * @file SchemaGenerator.php
 * @author <NAME>, 2011, <EMAIL>
 * @copyright 2012 Naturwerk, Brugg
 *
 * Converts a DLL-Schema (*.sql, PostgreSQL), generated by ERMaster (ermaster.sf.net)
 * into a Drupal Schema (Schema API)
 *
 * WARNING: its a quick hack and does just what I need (hopefully) and that's it - its
 * not nice, it's not flexible and there are no comments. Take it or leave it.
 */
$arguments = getopt("i:o:m:");

if (!file_exists($arguments['i'])) {
	die("File " . $arguments['i'] . " does not exist!\n");
}
$filename = $arguments['i'];

if (!isset($arguments['m'])) {
	die("No modulname (-m) given!\n");
}
$modulname = $arguments['m'];

function getNextLine(&$input) {
	if ($line = fgets($input)) {
		return trim($line);
	}
	return false;
}

function getComment(&$line) {
	if (preg_match('/^--(.+)/', $line, $match)) {
		return $match[1];
	}
	return false;
}<commit_msg>Exit if no filename given<commit_after><?php

/**
 * @file SchemaGenerator.php
 * @author <NAME>, 2011, <EMAIL>
 * @copyright 2012 Naturwerk, Brugg
 *
 * Converts a DLL-Schema (*.sql, PostgreSQL), generated by ERMaster (ermaster.sf.net)
 * into a Drupal Schema (Schema API)
 *
 * WARNING: its a quick hack and does just what I need (hopefully) and that's it - its
 * not nice, it's not flexible and there are no comments. Take it or leave it.
 */
$arguments = getopt("i:o:m:");

if (!isset($arguments['i'])) {
	die("No filename (-i) given!\n");
}

if (!file_exists($arguments['i'])) {
	die("File " . $arguments['i'] . " does not exist!\n");
}
$filename = $arguments['i'];

if (!isset($arguments['m'])) {
	die("No modulname (-m) given!\n");
}
$modulname = $arguments['m'];

function getNextLine(&$input) {
	if ($line = fgets($input)) {
		return trim($line);
	}
	return false;
}

function getComment(&$line) {
	if (preg_match('/^--(.+)/', $line, $match)) {
		return $match[1];
	}
	return false;
}
{'fraction_non_alphanumeric': 0.20031463030938648, 'fraction_numerical': 0.009438909281594127, 'mean_word_length': 4.256198347107438, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '490260', 'n_tokens_mistral': 703, 'n_tokens_neox': 673, 'n_words': 200}