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

#pragma once

#include <cstdint>

namespace search::multivalue {

template <typename T>
class Value {
public:
    Value() noexcept : _v() {}
    Value(T v) noexcept : _v(v) { }
    Value(T v, int32_t w) noexcept : _v(v) { (void) w; }
    T value()           const { return _v; }
    const T& value_ref() const { return _v; }
    T& value_ref()            { return _v; }
    operator T ()       const { return _v; }
    operator T & ()           { return _v; }
    int32_t weight()    const { return 1; }
    void setWeight(int32_t w) { (void) w; }
    bool operator ==(const Value<T> & rhs) const { return _v == rhs._v; }
    bool operator <(const Value<T> & rhs) const { return _v < rhs._v; }
    bool operator >(const Value<T> & rhs) const { return _v > rhs._v; }
private:
    T _v;
};

template <typename T>
class WeightedValue {
public:
    WeightedValue() noexcept : _v(), _w(1) { }
    WeightedValue(T v, int32_t w) noexcept : _v(v), _w(w) { }
    T value()             const { return _v; }
    const T& value_ref() const  { return _v; }
    T& value_ref()              { return _v; }
    operator T ()         const { return _v; }
    operator T & ()             { return _v; }
    int32_t weight()      const { return _w; }
    void setWeight(int32_t w)   { _w = w; }

    bool operator==(const WeightedValue<T> & rhs) const { return _v == rhs._v; }
    bool operator <(const WeightedValue<T> & rhs) const { return _v < rhs._v; }
    bool operator >(const WeightedValue<T> & rhs) const { return _v > rhs._v; }
private:
    T       _v;
    int32_t _w;
};

}<commit_msg>Remove unused setWeight() member functions.<commit_after>// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <cstdint>

namespace search::multivalue {

template <typename T>
class Value {
public:
    Value() noexcept : _v() {}
    Value(T v) noexcept : _v(v) { }
    Value(T v, int32_t w) noexcept : _v(v) { (void) w; }
    T value()           const { return _v; }
    const T& value_ref() const { return _v; }
    T& value_ref()            { return _v; }
    operator T ()       const { return _v; }
    operator T & ()           { return _v; }
    int32_t weight()    const { return 1; }
    bool operator ==(const Value<T> & rhs) const { return _v == rhs._v; }
    bool operator <(const Value<T> & rhs) const { return _v < rhs._v; }
    bool operator >(const Value<T> & rhs) const { return _v > rhs._v; }
private:
    T _v;
};

template <typename T>
class WeightedValue {
public:
    WeightedValue() noexcept : _v(), _w(1) { }
    WeightedValue(T v, int32_t w) noexcept : _v(v), _w(w) { }
    T value()             const { return _v; }
    const T& value_ref() const  { return _v; }
    T& value_ref()              { return _v; }
    operator T ()         const { return _v; }
    operator T & ()             { return _v; }
    int32_t weight()      const { return _w; }

    bool operator==(const WeightedValue<T> & rhs) const { return _v == rhs._v; }
    bool operator <(const WeightedValue<T> & rhs) const { return _v < rhs._v; }
    bool operator >(const WeightedValue<T> & rhs) const { return _v > rhs._v; }
private:
    T       _v;
    int32_t _w;
};

}
{'fraction_non_alphanumeric': 0.1342925659472422, 'fraction_numerical': 0.009592326139088728, 'mean_word_length': 2.4085801838610825, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '1085029', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1148, 'n_words': 376}