<commit_before>#ifndef _INCLUDED_CODER_HPP_
#define _INCLUDED_CODER_HPP_

#include <tudocomp/env.h>
#include <tudocomp/io.h>

namespace tudocomp {

/// A coder for factors of type F.
template<typename F>
class Coder {

public:
    /// The default constructor is not supported.
    Coder() = delete;
    
    /// Constructor for an environment.
    Coder(Env& env) {
    }
    
    /// Destructor
    ~Coder() {
    }
    
    /// Initiates the encoding with no information about the original length.
    virtual void encode_init(Output& out) = 0;

    /// Initiates the encoding with information about the original length.
    virtual void encode_init(Output& out, size_t len) = 0;
    
    /// Encodes a raw symbol.
    virtual void encode_sym(Output& out, char32_t sym) = 0;
    
    /// Encodes a factor of the supported type.
    virtual void encode_fact(Output& out, const F& fact) = 0;
    
    /// Finalizes the encoding.
    virtual void encode_finalize(Output& out) = 0;
    
    /// Decodes and defactorizes the input
    virtual void decode(Input& in, Output& out) = 0;
};

}

#endif<commit_msg>Changed/Removed the Coder<T> class as a to-be-inherited from class.<commit_after>#ifndef _INCLUDED_EXAMPLE_CODER_HPP_
#define _INCLUDED_EXAMPLE_CODER_HPP_

#include <tudocomp/env.h>
#include <tudocomp/io.h>

namespace tudocomp {

/// Example interface of a coder.
///
/// A Coder implementation needs to implement all listed
/// methods and constructors.
template<typename F>
class ExampleCoder {
public:
    /// Construct a Coder that writes to a given Output
    ExampleCoder(Env& env, Output& out) {
    }

    /// Construct a Coder that writes to a given Output and that will write
    /// `len` bytes.
    ExampleCoder(Env& env, Output& out, size_t len) {
    }

    /// Destructor, should finalize any work on the Output stream.
    ~ExampleCoder() {
    }

    /// Encodes a raw symbol (ie, byte) of the input.
    void encode_sym(uint8_t sym) {
    }

    /// Encodes a factor of the supported type.
    void encode_fact(const F& fact) {
    }

    /// Decodes and defactorizes the input
    static void decode(Input& in, Output& out) {
    }
};

}

#endif
{'fraction_non_alphanumeric': 0.10276497695852535, 'fraction_numerical': 0.004147465437788019, 'mean_word_length': 2.7302405498281788, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '4090558', 'n_tokens_mistral': 720, 'n_tokens_neox': 702, 'n_words': 233}