<commit_before>/* gdomdocument.c
 *
 * Copyright (C) 2007  <NAME>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	<NAME> <<EMAIL>>
 */

#include <gdomdocument.h>
#include <gdomtext.h>

GDomText *
gdom_document_create_text_node_base (GDomDocument *document, const char *data)
{
	return GDOM_TEXT (gdom_text_new (data));
}

GDomText *
gdom_document_create_text_node (GDomDocument *document, const char *data)
{
	g_return_val_if_fail (GDOM_IS_DOCUMENT (document), NULL);

	return GDOM_DOCUMENT_GET_CLASS (document)->create_text_node (document, data);
}

static void
gdom_document_init (GDomDocument *document)
{
}

static void
gdom_document_class_init (GDomDocumentClass *klass)
{
	klass->create_text_node = gdom_document_create_text_node_base;
}

G_DEFINE_ABSTRACT_TYPE (GDomDocument, gdom_document, GDOM_TYPE_NODE)

<commit_msg>Add implementation of get_node_name and get_node_type for GDomDocument.<commit_after>/* gdomdocument.c
 *
 * Copyright (C) 2007  <NAME>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	<NAME> <<EMAIL>>
 */

#include <gdomdocument.h>
#include <gdomtext.h>

static char *
gdom_document_get_node_name (GDomNode *node)
{
	return "#document";
}

static GDomNodeType
gdom_document_get_node_type (GDomNode *node)
{
	return GDOM_NODE_TYPE_DOCUMENT_NODE;
}

GDomText *
gdom_document_create_text_node_base (GDomDocument *document, const char *data)
{
	return GDOM_TEXT (gdom_text_new (data));
}

GDomText *
gdom_document_create_text_node (GDomDocument *document, const char *data)
{
	g_return_val_if_fail (GDOM_IS_DOCUMENT (document), NULL);

	return GDOM_DOCUMENT_GET_CLASS (document)->create_text_node (document, data);
}

static void
gdom_document_init (GDomDocument *document)
{
}

static void
gdom_document_class_init (GDomDocumentClass *klass)
{
	GDomNodeClass *node_class = GDOM_NODE_CLASS (klass);

	node_class->get_node_name = gdom_document_get_node_name;
	node_class->get_node_type = gdom_document_get_node_type;

	klass->create_text_node = gdom_document_create_text_node_base;
}

G_DEFINE_ABSTRACT_TYPE (GDomDocument, gdom_document, GDOM_TYPE_NODE)
{'fraction_non_alphanumeric': 0.07756874095513748, 'fraction_numerical': 0.009261939218523878, 'mean_word_length': 5.329670329670329, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, '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': '6843262', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1095, 'n_words': 367}