<commit_before>package gbrotli

import (
	"io"

	"github.com/dsnet/compress/brotli"
	"github.com/itchio/wharf/pwr"
)

type brotliDecompressor struct{}

func (bc *brotliDecompressor) Apply(reader io.Reader) (io.Reader, error) {
	br := brotli.NewReader(reader, nil)
	return br, nil
}

func init() {
	pwr.RegisterDecompressor(pwr.CompressionAlgorithm_BROTLI, &brotliDecompressor{})
}<commit_msg>Adjust to new dsnet/compress API, pt. 2<commit_after>package gbrotli

import (
	"io"

	"github.com/dsnet/compress/brotli"
	"github.com/go-errors/errors"
	"github.com/itchio/wharf/pwr"
)

type brotliDecompressor struct{}

func (bc *brotliDecompressor) Apply(reader io.Reader) (io.Reader, error) {
	br, err := brotli.NewReader(reader, nil)
	if err != nil {
		return nil, errors.Wrap(err, 1)
	}
	return br, nil
}

func init() {
	pwr.RegisterDecompressor(pwr.CompressionAlgorithm_BROTLI, &brotliDecompressor{})
}
{'fraction_non_alphanumeric': 0.13666666666666666, 'fraction_numerical': 0.0022222222222222222, 'mean_word_length': 5.300699300699301, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2341114', 'n_tokens_mistral': 369, 'n_tokens_neox': 358, 'n_words': 67}