<commit_before>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Copyright (C) 2006, Mr <NAME> (<EMAIL>)
 * Copyright (C) 2008, Nokia (<EMAIL>)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 */

#ifndef __LIBTRACKER_COMMON_UTILS_H__
#define __LIBTRACKER_COMMON_UTILS_H__

#include <glib.h>

#if !defined (__LIBTRACKER_COMMON_INSIDE__) && !defined (TRACKER_COMPILATION)
#error "only <libtracker-common/tracker-common.h> must be included directly."
#endif

gboolean tracker_is_empty_string            (const char  *str);
gboolean tracker_is_blank_string            (const char  *str);
gchar *  tracker_string_replace             (const gchar *haystack,
					     const gchar *needle,
					     const gchar *replacement);
gchar *  tracker_string_remove              (gchar       *haystack,
					     const gchar *needle);
gchar *  tracker_seconds_estimate_to_string (gdouble      seconds_elapsed,
					     gboolean     short_string,
					     guint        items_done,
					     guint        items_remaining);
gchar *  tracker_seconds_to_string          (gdouble      seconds_elapsed,
					     gboolean     short_string);
gchar*   tracker_uri_vprintf_escaped        (const gchar *format,
					     va_list      args);
gchar*   tracker_uri_printf_escaped         (const gchar *format,
					     ...);
gchar *  tracker_coalesce                   (gint n_values,
					     ...);
gchar *  tracker_merge                      (const gchar *delim, gint n_values,
					     ...);

gchar *  tracker_text_normalize             (const gchar *text,
					     guint        max_words,
					     guint       *n_words);

/* Temporary: Just here until we upgrade to GLib 2.18. */
G_CONST_RETURN gchar *
         tracker_dngettext                  (const gchar *domain,
					     const gchar *msgid,
					     const gchar *msgid_plural,
					     gulong       n);

#endif /* __LIBTRACKER_COMMON_UTILS_H__ */<commit_msg>libtracker-common: Add G_{BEGIN|END}_DECLS to tracker-utils.h<commit_after>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Copyright (C) 2006, Mr <NAME> (<EMAIL>)
 * Copyright (C) 2008, Nokia (<EMAIL>)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 */

#ifndef __LIBTRACKER_COMMON_UTILS_H__
#define __LIBTRACKER_COMMON_UTILS_H__

#include <glib.h>

G_BEGIN_DECLS

#if !defined (__LIBTRACKER_COMMON_INSIDE__) && !defined (TRACKER_COMPILATION)
#error "only <libtracker-common/tracker-common.h> must be included directly."
#endif

gboolean tracker_is_empty_string            (const char  *str);
gboolean tracker_is_blank_string            (const char  *str);
gchar *  tracker_string_replace             (const gchar *haystack,
					     const gchar *needle,
					     const gchar *replacement);
gchar *  tracker_string_remove              (gchar       *haystack,
					     const gchar *needle);
gchar *  tracker_seconds_estimate_to_string (gdouble      seconds_elapsed,
					     gboolean     short_string,
					     guint        items_done,
					     guint        items_remaining);
gchar *  tracker_seconds_to_string          (gdouble      seconds_elapsed,
					     gboolean     short_string);
gchar*   tracker_uri_vprintf_escaped        (const gchar *format,
					     va_list      args);
gchar*   tracker_uri_printf_escaped         (const gchar *format,
					     ...);
gchar *  tracker_coalesce                   (gint n_values,
					     ...);
gchar *  tracker_merge                      (const gchar *delim, gint n_values,
					     ...);

gchar *  tracker_text_normalize             (const gchar *text,
					     guint        max_words,
					     guint       *n_words);

/* Temporary: Just here until we upgrade to GLib 2.18. */
G_CONST_RETURN gchar *
         tracker_dngettext                  (const gchar *domain,
					     const gchar *msgid,
					     const gchar *msgid_plural,
					     gulong       n);

G_END_DECLS

#endif /* __LIBTRACKER_COMMON_UTILS_H__ */
{'fraction_non_alphanumeric': 0.07993260950954699, 'fraction_numerical': 0.009734181954324224, 'mean_word_length': 2.5572569906790945, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3000359', 'n_tokens_mistral': 1826, 'n_tokens_neox': 1588, 'n_words': 518}