<commit_before>package main

import (
	"bufio"
	"fmt"
	"github.com/mg/i"
	"io"
	"os"
	"strings"
)

type fh struct {
	in   *bufio.Reader
	line string
	err  error
}

func Fh(in io.Reader) i.Forward {
	f := fh{in: bufio.NewReader(in)}
	f.Next()
	return &f
}

func (f *fh) Error() error {
	if f.err == io.EOF {
		return nil
	}
	return f.err
}
<commit_msg>fh: add SetError()<commit_after>package main

import (
	"bufio"
	"fmt"
	"github.com/mg/i"
	"io"
	"os"
	"strings"
)

type fh struct {
	in   *bufio.Reader
	line string
	err  error
}

func Fh(in io.Reader) i.Forward {
	f := fh{in: bufio.NewReader(in)}
	f.Next()
	return &f
}

func (f *fh) Error() error {
	if f.err == io.EOF {
		return nil
	}
	return f.err
}

func (f *fh) SetError(err error) {
	f.err = err
}

{'fraction_non_alphanumeric': 0.16358839050131926, 'fraction_numerical': 0.0, 'mean_word_length': 2.9947368421052634, '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': '1604210', 'n_tokens_mistral': 364, 'n_tokens_neox': 357, 'n_words': 89}