<commit_before>package ssdeep

/*
#cgo linux LDFLAGS:-L/usr/local/lib/ -lfuzzy -ldl -I/usr/local/include/
#include <stdlib.h>
#include <fuzzy.h>
*/
import "C"

import (
	"errors"
	"unsafe"
)

type FuzzyState struct {
	cstate *_Ctype_struct_fuzzy_state
}

/*
Construct a fuzzy_state object and return it.
*/
func New() (*FuzzyState, error) {
	var cstate *_Ctype_struct_fuzzy_state
	if cstate = C.fuzzy_new(); cstate == nil {
		return nil, errors.New("")
	}
	return &FuzzyState{cstate}, nil
}

/*
Create a copy of a fuzzy_state object and return it.
*/
func (fs *FuzzyState) Clone() (*FuzzyState, error) {
	var cstate *_Ctype_struct_fuzzy_state
	if cstate = C.fuzzy_clone(fs.cstate); cstate == nil {
		return nil, errors.New("")
	}
	return &FuzzyState{cstate}, nil
}

/*
Dispose a fuzzy state.
*/
func (fs *FuzzyState) Free() {
	C.fuzzy_free(fs.cstate)
}

/*
Feed the data contained in the given buffer to the state.<F37>
*/
func (fs *FuzzyState) Update(str string) error {
	cstr := C.CString(str)
	defer C.free(unsafe.Pointer(cstr))

	length := C.size_t(len(str))
	if C.fuzzy_update(fs.cstate, (*C.uchar)(unsafe.Pointer(cstr)), length) != 0 {
		return errors.New("")
	}
<commit_msg>Update ssdeep.go<commit_after>package ssdeep

/*
#cgo linux LDFLAGS:-L/usr/local/lib/ -lfuzzy -ldl -I/usr/local/include/
#include <stdlib.h>
#include <fuzzy.h>
*/
import "C"

import (
	"errors"
	"unsafe"
)

type FuzzyState struct {
	cstate *
	C.struct_fuzzy_state
}

/*
Construct a fuzzy_state object and return it.
*/
func New() (*FuzzyState, error) {
	var cstate *C.struct_fuzzy_state
	if cstate = C.fuzzy_new(); cstate == nil {
		return nil, errors.New("")
	}
	return &FuzzyState{cstate}, nil
}

/*
Create a copy of a fuzzy_state object and return it.
*/
func (fs *FuzzyState) Clone() (*FuzzyState, error) {
	var cstate *C.struct_fuzzy_state
	if cstate = C.fuzzy_clone(fs.cstate); cstate == nil {
		return nil, errors.New("")
	}
	return &FuzzyState{cstate}, nil
}

/*
Dispose a fuzzy state.
*/
func (fs *FuzzyState) Free() {
	C.fuzzy_free(fs.cstate)
}

/*
Feed the data contained in the given buffer to the state.<F37>
*/
func (fs *FuzzyState) Update(str string) error {
	cstr := C.CString(str)
	defer C.free(unsafe.Pointer(cstr))

	length := C.size_t(len(str))
	if C.fuzzy_update(fs.cstate, (*C.uchar)(unsafe.Pointer(cstr)), length) != 0 {
		return errors.New("")
	}

{'fraction_non_alphanumeric': 0.1556122448979592, 'fraction_numerical': 0.002551020408163265, 'mean_word_length': 4.137554585152839, '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': '1134348', 'n_tokens_mistral': 1003, 'n_tokens_neox': 927, 'n_words': 233}