<commit_before>package kv

import (
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"

	"nimona.io/pkg/errors"
)

// diskStore stores the object in a file
type diskStore struct {
	path string
}

const (
	dataExt string = ".data"
)

// NewDiskStorage creates a new diskStore struct with the given path
// the files that will be generated from this struct are stored in the path
func NewDiskStorage(path string) (Store, error) {
	if err := os.MkdirAll(path, os.ModePerm); err != nil {
		return nil, err<commit_msg>refactor(store/kv): change file ext to json<commit_after>package kv

import (
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"

	"nimona.io/pkg/errors"
)

// diskStore stores the object in a file
type diskStore struct {
	path string
}

const (
	dataExt string = ".json"
)

// NewDiskStorage creates a new diskStore struct with the given path
// the files that will be generated from this struct are stored in the path
func NewDiskStorage(path string) (Store, error) {
	if err := os.MkdirAll(path, os.ModePerm); err != nil {
		return nil, err
{'fraction_non_alphanumeric': 0.10305343511450382, 'fraction_numerical': 0.0, 'mean_word_length': 3.8790697674418606, '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': '7296776', 'n_tokens_mistral': 354, 'n_tokens_neox': 351, 'n_words': 128}