<commit_before>///
/// @file utils.cpp
///
/// @Copyright (C) 2013 The Imaging Source GmbH; <NAME> <<EMAIL>>
///

#include "utils.h"

#include <sys/types.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <netdb.h>
#include <ifaddrs.h>
#include <arpa/inet.h>
#include <cstring>
#include <sstream>
#include <exception>
#include <stdexcept>

namespace tis
{

bool startsWith (const std::string& searchThrough, const std::string& searchFor)
{
    size_t lensearchThrough = searchThrough.size();
    size_t lenstr = searchFor.size();
    if (lenstr >= lensearchThrough)<commit_msg>Improved startsWith reliability<commit_after>///
/// @file utils.cpp
///
/// @Copyright (C) 2013 The Imaging Source GmbH; <NAME> <<EMAIL>>
///

#include "utils.h"

#include <sys/types.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <netdb.h>
#include <ifaddrs.h>
#include <arpa/inet.h>
#include <cstring>
#include <sstream>
#include <exception>
#include <stdexcept>

namespace tis
{

bool startsWith (const std::string& searchThrough, const std::string& searchFor)
{
    if (searchThrough.empty() || searchFor.empty())
    {
        return false;
    }

    size_t lensearchThrough = searchThrough.size();
    size_t lenstr = searchFor.size();
    if (lenstr > lensearchThrough)
{'fraction_non_alphanumeric': 0.1650943396226415, 'fraction_numerical': 0.006289308176100629, 'mean_word_length': 4.17479674796748, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, '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': '4912466', 'n_tokens_mistral': 475, 'n_tokens_neox': 449, 'n_words': 112}