<commit_before>/**
 * @file   DurationString.cpp
 * @brief  DurationString class implementation.
 * @author zer0
 * @date   2019-07-15
 */

#include <libtbag/time/DurationString.hpp>
#include <libtbag/string/StringUtils.hpp>

// -------------------
NAMESPACE_LIBTBAG_OPEN
// -------------------

namespace time {

template <typename DefaultDurationT>
static std::size_t __to_chrono_duration(std::string const & str)
{
    auto const lower_str = libtbag::string::trim(libtbag::string::lower(str));
    auto const size = lower_str.size();

    std::size_t i = 0;
    for (; i < size; ++i) {
        if (!std::isdigit(lower_str[i])) {
            break;
        }
    }
    // Skip space;<commit_msg>Fixed build error in MSVC.<commit_after>/**
 * @file   DurationString.cpp
 * @brief  DurationString class implementation.
 * @author zer0
 * @date   2019-07-15
 */

#include <libtbag/time/DurationString.hpp>
#include <libtbag/string/StringUtils.hpp>

#include <cctype>
#include <cassert>

// -------------------
NAMESPACE_LIBTBAG_OPEN
// -------------------

namespace time {

template <typename DefaultDurationT>
static std::size_t __to_chrono_duration(std::string const & str)
{
    auto const lower_str = libtbag::string::trim(libtbag::string::lower(str));
    auto const size = lower_str.size();

    std::size_t i = 0;
    for (; i < size; ++i) {
        if (!std::isdigit(lower_str[i])) {
            break;
        }
    }
    // Skip space;
{'fraction_non_alphanumeric': 0.1875432525951557, 'fraction_numerical': 0.01384083044982699, 'mean_word_length': 2.6793893129770994, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '5808210', 'n_tokens_mistral': 496, 'n_tokens_neox': 473, 'n_words': 99}