<commit_before>package index

import (
	"bytes"
	"encoding/binary"
	"encoding/gob"
	"github.com/maxnordlund/adk/labb1/lexer"
	"io"
	"math"
	"os"
	"sort"
)

const SIZE = 8

// Pointer within a file
type filePointer uint64
<commit_msg>Add Create using New*Index<commit_after>package index

import (
	"bytes"
	"encoding/binary"
	"encoding/gob"
	"github.com/maxnordlund/adk/labb1/lexer"
	"io"
	"math"
	"os"
	"sort"
)

const SIZE = 8

func Create() (err error) {
	fi, err := NewFileIndex("data/korpus")
	if err != nil {
		return
	}
	si, err := NewSearchIndex("data/index", fi)
	if err != nil {
		return
	}
	li, err := NewLazyHashIndex("data/search", si)
	if err != nil {
		return
	}
	err = li.save("data/lazy")
	return
}

// Pointer within a file
type filePointer uint64

{'fraction_non_alphanumeric': 0.14882506527415143, 'fraction_numerical': 0.010443864229765013, 'mean_word_length': 3.734567901234568, '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': '3786103', 'n_tokens_mistral': 330, 'n_tokens_neox': 318, 'n_words': 75}