<commit_before>package markov

import (
	"github.com/mandykoh/keva"
)

type DiskBasedTableStore struct {
	KevaStore *keva.Store
}

func (ts *DiskBasedTableStore) Close() error {
	return ts.KevaStore.Close()
}

func (ts *DiskBasedTableStore) Get(key SequenceKey, dest *Table) error {
	return ts.KevaStore.Get(string(key), dest)
}

func (ts *DiskBasedTableStore) Put(key SequenceKey, table *Table) error {
	return ts.KevaStore.Put(string(key), table)
}<commit_msg>Map Keva not found errors to ErrTableNotFound.<commit_after>package markov

import (
	"github.com/mandykoh/keva"
)

type DiskBasedTableStore struct {
	KevaStore *keva.Store
}

func (ts *DiskBasedTableStore) Close() error {
	return ts.KevaStore.Close()
}

func (ts *DiskBasedTableStore) Get(key SequenceKey, dest *Table) error {
	err := ts.KevaStore.Get(string(key), dest)
	if err == keva.ErrValueNotFound {
		return ErrTableNotFound
	}
	return err
}

func (ts *DiskBasedTableStore) Put(key SequenceKey, table *Table) error {
	return ts.KevaStore.Put(string(key), table)
}
{'fraction_non_alphanumeric': 0.1181026137463698, 'fraction_numerical': 0.0, 'mean_word_length': 5.50314465408805, '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': '2448674', 'n_tokens_mistral': 373, 'n_tokens_neox': 362, 'n_words': 89}