<commit_before>// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "slimefieldwriter.h"
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
#include <vespa/vespalib/stllike/asciistream.h>

#include <vespa/log/log.h>
LOG_SETUP(".vsm.slimefieldwriter");

namespace {

vespalib::string
toString(const vsm::FieldPath & fp)
{
    vespalib::asciistream oss;
    for (size_t i = 0; i < fp.size(); ++i) {
        if (i > 0) {
            oss << ".";
        }
        oss << fp[i].getName();
    }
    return oss.str();
}

vespalib::string
toString(const std::vector<vespalib::string> & fp)
{
    vespalib::asciistream oss;
    for (size_t i = 0; i < fp.size(); ++i) {
        if (i > 0) {
            oss << ".";
        }
        oss << fp[i];
    }
    return oss.str();
}

} // namespace <unnamed><commit_msg>fp -> fieldPath for readability.<commit_after>// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "slimefieldwriter.h"
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
#include <vespa/vespalib/stllike/asciistream.h>

#include <vespa/log/log.h>
LOG_SETUP(".vsm.slimefieldwriter");

namespace {

vespalib::string
toString(const vsm::FieldPath & fieldPath)
{
    vespalib::asciistream oss;
    for (size_t i = 0; i < fieldPath.size(); ++i) {
        if (i > 0) {
            oss << ".";
        }
        oss << fieldPath[i].getName();
    }
    return oss.str();
}

vespalib::string
toString(const std::vector<vespalib::string> & fieldPath)
{
    vespalib::asciistream oss;
    for (size_t i = 0; i < fieldPath.size(); ++i) {
        if (i > 0) {
            oss << ".";
        }
        oss << fieldPath[i];
    }
    return oss.str();
}

} // namespace <unnamed>
{'fraction_non_alphanumeric': 0.15732172019597168, 'fraction_numerical': 0.010887316276537834, 'mean_word_length': 2.7586912065439675, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 18, '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': '4643235', 'n_tokens_mistral': 694, 'n_tokens_neox': 659, 'n_words': 150}