<commit_before>// Package gedcom implements a parser to read genealogical data in a standard format
package gedcom

import (
	"io"
	"strconv"

	"github.com/MJKWoolnough/errors"
	"github.com/MJKWoolnough/parser"
)

type line struct {
	level  uint64
	xrefID string
	tag    string
	value  string
}

// Reader reads Records from the underlying GEDCOM file
type Reader struct {
	t       *tokeniser
	options options

	peeked bool
	line   line
	err    error
	done   bool

	hadHeader, hadRecord bool
}

// NewReader creates a new Reader, setting the given options
func NewReader(r io.Reader, opts ...Option) *Reader {
	var o options
	for _, opt := range opts {
		opt(&o)
	}
	return &Reader{
		t:       newTokeniser(r, o),
		options: o,
	}
}

func (r *Reader) readLine() {
	if r.err != nil {
		return
	}
	var t parser.Token
	t, r.err = r.t.GetToken()<commit_msg>reordered struct fields to reduce size (alignment issues)<commit_after>// Package gedcom implements a parser to read genealogical data in a standard format
package gedcom

import (
	"io"
	"strconv"

	"github.com/MJKWoolnough/errors"
	"github.com/MJKWoolnough/parser"
)

type line struct {
	level  uint64
	xrefID string
	tag    string
	value  string
}

// Reader reads Records from the underlying GEDCOM file
type Reader struct {
	t *tokeniser

	line line
	err  error

	options options

	peeked bool
	done   bool

	hadHeader, hadRecord bool
}

// NewReader creates a new Reader, setting the given options
func NewReader(r io.Reader, opts ...Option) *Reader {
	var o options
	for _, opt := range opts {
		opt(&o)
	}
	return &Reader{
		t:       newTokeniser(r, o),
		options: o,
	}
}

func (r *Reader) readLine() {
	if r.err != nil {
		return
	}
	var t parser.Token
	t, r.err = r.t.GetToken()
{'fraction_non_alphanumeric': 0.09184845005740529, 'fraction_numerical': 0.002296211251435132, 'mean_word_length': 3.2305825242718447, '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': '1390738', 'n_tokens_mistral': 642, 'n_tokens_neox': 611, 'n_words': 210}