<commit_before>package jsonstructure

import (
	"fmt"
	"strings"
)

type SchemaError struct {
	Scope []string
	Err   error
}

type EnumError struct {
	SchemaError
}

func (e *SchemaError) Error() string {
	return fmt.Sprintf("At /%s: %s", strings.Join(e.Scope, "/"), e.Err.Error())
}

func (e *EnumError) Error() string {
	return fmt.Sprintf("At /%s: %s", strings.Join(e.Scope, "/"), e.Err.Error())
}

func errorAt(err error, scope []string) error {
	if err == nil {
		return nil
	}
	return &SchemaError{
		Scope: scope,
		Err:   err,
	}
}

func enumError(err error, scope []string) error {
	if err == nil {
		return nil
	}
	return &EnumError{
		SchemaError: SchemaError{
			Scope: scope,
			Err:   err,
		},
	}
}<commit_msg>Convert scope from []string to formatting string when error is generated.<commit_after>package jsonstructure

import (
	"fmt"
	"strings"
)

type SchemaError struct {
	Scope string
	Err   error
}

type EnumError struct {
	SchemaError
}

func (e *SchemaError) Error() string {
	return fmt.Sprintf("At %s: %s", e.Scope, e.Err.Error())
}

func (e *EnumError) Error() string {
	return fmt.Sprintf("At %s: %s", e.Scope, e.Err.Error())
}

func errorAt(err error, scope []string) error {
	if err == nil {
		return nil
	}
	msg := "/" + strings.Join(scope, "/")
	return &SchemaError{
		Scope: msg,
		Err:   err,
	}
}

func enumError(err error, scope []string) error {
	if err == nil {
		return nil
	}
	msg := "/" + strings.Join(scope, "/")
	return &EnumError{
		SchemaError: SchemaError{
			Scope: msg,
			Err:   err,
		},
	}
}
{'fraction_non_alphanumeric': 0.1562905317769131, 'fraction_numerical': 0.0, 'mean_word_length': 3.538235294117647, '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': '7124925', 'n_tokens_mistral': 588, 'n_tokens_neox': 565, 'n_words': 162}