<commit_before>package gomposer

import (
    "os"

    "encoding/json"
)

type Reader interface {
	Read(filename string) *Version
}

type PackageReader struct {
}

func (pr PackageReader) Read(filename string) (*Version, error) {

    buf, err := os.Open(filename)

    if err != nil {
        return nil, err
    }

    output := &Version{}

    json.NewDecoder(buf).Decode(output)

	return output, nil
}<commit_msg>Refactor dependency resolver + add test for later on<commit_after>package gomposer

import (
	"os"

	"encoding/json"
)

type Reader interface {
	Read(filename string) *Version
}

type PackageReader struct {
}

func (pr PackageReader) Read(filename string) (*Version, error) {

	buf, err := os.Open(filename)

	if err != nil {
		return nil, err
	}

	output := &Version{}

	json.NewDecoder(buf).Decode(output)

	return output, nil
}
{'fraction_non_alphanumeric': 0.11910377358490566, 'fraction_numerical': 0.0, 'mean_word_length': 3.6648351648351647, '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': '7010417', 'n_tokens_mistral': 288, 'n_tokens_neox': 271, 'n_words': 79}