<commit_before><?
// The source code packaged with this file is Free Software, Copyright (C) 2008 by
// <NAME> <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

class Annotation {
	var $key = false;
	var $time;
	var $text;

	function Annotation($key = false) {
		if ($key) $this->key = $key;
		return;
	}

	function store() {
		global $db;

		if (empty($this->key) || empty($this->text)) return false;

		$key = $db->escape($this->key);
		$text = $db->escape($this->text);
		$db->query("REPLACE INTO annotations (annotation_key, annotation_text) VALUES ('$key', '$text')");
	}

	function read($key = false) {
		global $db;

		if ($key) $this->key = $key;
		if (empty($this->key)) return false;
<commit_msg>Permite anotaciones sin texto.<commit_after><?
// The source code packaged with this file is Free Software, Copyright (C) 2008 by
// <NAME> <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

class Annotation {
	var $key = false;
	var $time;
	var $text = '';

	function Annotation($key = false) {
		if ($key) $this->key = $key;
		return;
	}

	function store() {
		global $db;

		if (empty($this->key)) return false;

		$key = $db->escape($this->key);
		$text = $db->escape($this->text);
		$db->query("REPLACE INTO annotations (annotation_key, annotation_text) VALUES ('$key', '$text')");
	}

	function read($key = false) {
		global $db;

		if ($key) $this->key = $key;
		if (empty($this->key)) return false;

{'fraction_non_alphanumeric': 0.15945945945945947, 'fraction_numerical': 0.004324324324324324, 'mean_word_length': 3.770618556701031, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '356439', 'n_tokens_mistral': 678, 'n_tokens_neox': 609, 'n_words': 210}