<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "smaz.h"

#include "ruby.h"

VALUE BadCompression = Qnil;
VALUE Ohm = Qnil;
VALUE Helpers = Qnil;
VALUE Smaz = Qnil;

// Prototypes
void Init_smaz_ohm();
VALUE method_compress(VALUE self, VALUE str);
VALUE method_decompress(VALUE self, VALUE compressed);

void Init_smaz_ohm() {
	Ohm = rb_const_get(rb_cObject, rb_intern("Ohm"));
	Helpers = rb_const_get(Ohm, rb_intern("Helpers"));
	Smaz = rb_define_module_under(Ohm, "Smaz");
	BadCompression = rb_define_class_under(Smaz, "BadCompression", rb_const_get(rb_cObject, rb_intern("StandardError")));

	rb_define_module_function(Smaz, "compress", method_compress, 1);
	rb_define_module_function(Smaz, "decompress", method_decompress, 1);
}

VALUE method_compress(VALUE self, VALUE str) {
	char* str_c = RSTRING_PTR(str);
	int len = RSTRING_LEN(str);
	char* output = malloc(len); // This'll be plenty of space, especially since this will be compressed

	int out_size = smaz_compress(str_c, len, output, len);<commit_msg>remove unnecessary variable declaration<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "smaz.h"

#include "ruby.h"

VALUE BadCompression = Qnil;
VALUE Ohm = Qnil;
VALUE Helpers = Qnil;
VALUE Smaz = Qnil;

// Prototypes
void Init_smaz_ohm();
VALUE method_compress(VALUE self, VALUE str);
VALUE method_decompress(VALUE self, VALUE compressed);

void Init_smaz_ohm() {
	Ohm = rb_const_get(rb_cObject, rb_intern("Ohm"));
	Helpers = rb_const_get(Ohm, rb_intern("Helpers"));
	Smaz = rb_define_module_under(Ohm, "Smaz");
	BadCompression = rb_define_class_under(Smaz, "BadCompression", rb_const_get(rb_cObject, rb_intern("StandardError")));

	rb_define_module_function(Smaz, "compress", method_compress, 1);
	rb_define_module_function(Smaz, "decompress", method_decompress, 1);
}

VALUE method_compress(VALUE self, VALUE str) {
	int len = RSTRING_LEN(str);
	char* output = malloc(len); // This'll be plenty of space, especially since this will be compressed

	int out_size = smaz_compress(RSTRING_PTR(str), len, output, len);
{'fraction_non_alphanumeric': 0.12535748331744517, 'fraction_numerical': 0.0019065776930409914, 'mean_word_length': 6.980988593155893, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2814072', 'n_tokens_mistral': 766, 'n_tokens_neox': 767, 'n_words': 179}