<commit_before>// Copyright (c) 2013, <NAME>,  Object Computing, Inc.
// All rights reserved.
//
// This file is part of mFAST.
//
//     mFAST 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 3 of the License, or
//     (at your option) any later version.
//
//     mFAST 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 General Public License for more details.
//
//     You should have received a copy of the GNU Lesser General Public License
//     along with mFast.  If not, see <http://www.gnu.org/licenses/>.
//
#ifndef STRING_H_KP519AYB
#define STRING_H_KP519AYB

#include <string>
#include "mfast/field_ref.h"
#include "mfast/vector_ref.h"

namespace mfast {


template <typename Instruction>
class string_cref_base
  : public vector_cref_base<char, Instruction>
{
public:
  string_cref_base()
  {
  }

  string_cref_base(const string_cref_base& other)
    : vector_cref_base<char, Instruction>(other)
  {
  }

  string_cref_base(const value_storage* storage,
                   const Instruction*   instruction)
    : vector_cref_base<char, Instruction>(storage, instruction)
  {
  }

  explicit string_cref_base(const field_cref& other)
    : vector_cref_base<char, Instruction>(other)
  {
  }

#if defined(BOOST_HAS_RVALUE_REFS) && !(defined(_MSC_VER) && (_MSC_VER < 1700))
  std::string&& value() const
  {
    return std::move(std::string(this->data(), this->size()));
  }
#else
  std::string value() const
  {
    return std::string(this->data(), this->size());
  }

#endif


  bool operator == (const char* other) const
  {
    return compare(other) == 0;
  }

  bool operator == (const std::string& other) const
  {
    return compare(other) == 0;<commit_msg>Change the return type of string_cref::value() to boost::string_ref<commit_after>// Copyright (c) 2013, <NAME>,  Object Computing, Inc.
// All rights reserved.
//
// This file is part of mFAST.
//
//     mFAST 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 3 of the License, or
//     (at your option) any later version.
//
//     mFAST 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 General Public License for more details.
//
//     You should have received a copy of the GNU Lesser General Public License
//     along with mFast.  If not, see <http://www.gnu.org/licenses/>.
//
#ifndef STRING_H_KP519AYB
#define STRING_H_KP519AYB

#include <string>
#include "mfast/field_ref.h"
#include "mfast/vector_ref.h"
#include <boost/utility/string_ref.hpp>

namespace mfast {


template <typename Instruction>
class string_cref_base
  : public vector_cref_base<char, Instruction>
{
public:
  string_cref_base()
  {
  }

  string_cref_base(const string_cref_base& other)
    : vector_cref_base<char, Instruction>(other)
  {
  }

  string_cref_base(const value_storage* storage,
                   const Instruction*   instruction)
    : vector_cref_base<char, Instruction>(storage, instruction)
  {
  }

  explicit string_cref_base(const field_cref& other)
    : vector_cref_base<char, Instruction>(other)
  {
  }


  boost::string_ref value() const
  {
    return boost::string_ref(this->data(), this->size());
  }

  bool operator == (const char* other) const
  {
    return compare(other) == 0;
  }

  bool operator == (const std::string& other) const
  {
    return compare(other) == 0;
{'fraction_non_alphanumeric': 0.10828356271098416, 'fraction_numerical': 0.007790184367696702, 'mean_word_length': 3.3772727272727274, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5593860', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1186, 'n_words': 383}