<commit_before>package prefer

import (
	"bufio"
	"os"
)

type Loader interface {
	Load(identifier string) ([]byte, error)
}

func NewLoader(identifier string) (loader Loader, err error) {
	switch identifier {
	default:
		return loader, nil
	}
}

type FileLoader struct{}

func (loader FileLoader) Load(identifier string) (result []byte, err error) {
	file, err := os.Open(identifier)
	check(err)
	defer file.Close()

	scanner := bufio.NewScanner(file)
	for scanner.Scan() {
		result = append(result, scanner.Bytes()...)
	}

	return result, err
}<commit_msg>Make FileLoader the default.<commit_after>package prefer

import (
	"bufio"
	"os"
)

type Loader interface {
	Load(identifier string) ([]byte, error)
}

func NewLoader(identifier string) (Loader, error) {
	switch identifier {
	default:
		return FileLoader{}, nil
	}
}

type FileLoader struct{}

func (loader FileLoader) Load(identifier string) (result []byte, err error) {
	file, err := os.Open(identifier)
	check(err)
	defer file.Close()

	for scanner := bufio.NewScanner(file); scanner.Scan(); {
		result = append(result, scanner.Bytes()...)
	}

	return result, err
}
{'fraction_non_alphanumeric': 0.13575865128660158, 'fraction_numerical': 0.0, 'mean_word_length': 4.64, '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': '3452788', 'n_tokens_mistral': 387, 'n_tokens_neox': 374, 'n_words': 107}