<commit_before>#ifndef __RANK_FILTER_BASE__
#define __RANK_FILTER_BASE__


#include <array>
#include <deque>
#include <cassert>
#include <functional>
#include <iostream>

#include <boost/container/set.hpp>
#include <boost/container/node_allocator.hpp>


namespace rank_filter
{

template<class I1,
         class I2>
inline void lineRankOrderFilter1D(const I1& src_begin, const I1& src_end,
        I2& dest_begin, I2& dest_end,
        size_t half_length, double rank)
{
    // Types in use.
    using T1 = typename std::iterator_traits<I1>::value_type;
    using T2 = typename std::iterator_traits<I2>::value_type;

    // Will ignore boundaries initially.
    // Then will try adding reflection.

    // Rank must be in the range 0 to 1
    assert((0 <= rank) && (rank <= 1));

    const size_t rank_pos = round(rank * (2 * half_length));

    // The position of the
    size_t window_begin = 0;

    // Lengths.
    const typename std::iterator_traits<I1>::difference_type src_size = src_end - src_begin;
    const typename std::iterator_traits<I2>::difference_type dest_size = dest_end - dest_begin;

    typedef boost::container::multiset< T1,
            std::less<T1>,
            boost::container::node_allocator<T1>,
            boost::container::tree_assoc_options< boost::container::tree_type<boost::container::scapegoat_tree> >::type> multiset;

    typedef std::deque< typename multiset::iterator > deque;

    multiset sorted_window;
    deque window_iters;

    // Get the initial sorted window.
    // Include the reflection.
    for (size_t j = half_length; j > 0; j--)
    {<commit_msg>include/rank_filter_base.hxx: Switch `using` statements to `typedef`.<commit_after>#ifndef __RANK_FILTER_BASE__
#define __RANK_FILTER_BASE__


#include <array>
#include <deque>
#include <cassert>
#include <functional>
#include <iostream>

#include <boost/container/set.hpp>
#include <boost/container/node_allocator.hpp>


namespace rank_filter
{

template<class I1,
         class I2>
inline void lineRankOrderFilter1D(const I1& src_begin, const I1& src_end,
        I2& dest_begin, I2& dest_end,
        size_t half_length, double rank)
{
    // Types in use.
    typedef typename std::iterator_traits<I1>::value_type T1;
    typedef typename std::iterator_traits<I2>::value_type T2;

    // Will ignore boundaries initially.
    // Then will try adding reflection.

    // Rank must be in the range 0 to 1
    assert((0 <= rank) && (rank <= 1));

    const size_t rank_pos = round(rank * (2 * half_length));

    // The position of the
    size_t window_begin = 0;

    // Lengths.
    const typename std::iterator_traits<I1>::difference_type src_size = src_end - src_begin;
    const typename std::iterator_traits<I2>::difference_type dest_size = dest_end - dest_begin;

    typedef boost::container::multiset< T1,
            std::less<T1>,
            boost::container::node_allocator<T1>,
            boost::container::tree_assoc_options< boost::container::tree_type<boost::container::scapegoat_tree> >::type> multiset;

    typedef std::deque< typename multiset::iterator > deque;

    multiset sorted_window;
    deque window_iters;

    // Get the initial sorted window.
    // Include the reflection.
    for (size_t j = half_length; j > 0; j--)
    {
{'fraction_non_alphanumeric': 0.11390079608083283, 'fraction_numerical': 0.014084507042253521, 'mean_word_length': 3.6209335219236207, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 41, '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': '5910257', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1029, 'n_words': 269}