<commit_before>package multiverse

import (
	"os"
	"testing"
)

func openTestingMultiverse() Multiverse {
	file, _ := os.Open("/home/rwertman/.diorite/multiverse.mtg")
	m, _ := Read(file)

	m.Initialize()
	return m
}

func TestPhoneticCorrection(t *testing.T) {
	m := openTestingMultiverse()

	if results := m.FuzzyNameSearch("asheok", 1); results[0].Name != "Ashiok, Nightmare Weaver" {
		t.Errorf("Searching for 'asheok' should return Ashiok, Nightmare Weaver. Got: %s\n", results[0].Name)
	}
}

func BenchmarkSingleWordFuzzyNameSearch(b *testing.B) {
	m := openTestingMultiverse()
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		m.FuzzyNameSearch("asheok", 15)
	}
}

func BenchmarkMultiplePartialWordFuzzyNameSearch(b *testing.B) {
	m := openTestingMultiverse()
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		m.FuzzyNameSearch("ava me", 15)
	}
}

func BenchmarkSingleLetterFuzzyNameSearch(b *testing.B) {
	m := openTestingMultiverse()
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		m.FuzzyNameSearch("d", 15)
	}
}<commit_msg>Added benchmark for searching for full name.<commit_after>package multiverse

import (
	"os"
	"testing"
)

func openTestingMultiverse() Multiverse {
	file, _ := os.Open("/home/rwertman/.diorite/multiverse.mtg")
	m, _ := Read(file)

	m.Initialize()
	return m
}

func TestPhoneticCorrection(t *testing.T) {
	m := openTestingMultiverse()

	if results := m.FuzzyNameSearch("asheok", 1); results[0].Name != "Ashiok, Nightmare Weaver" {
		t.Errorf("Searching for 'asheok' should return Ashiok, Nightmare Weaver. Got: %s\n", results[0].Name)
	}
}

func BenchmarkSingleWordFuzzyNameSearch(b *testing.B) {
	m := openTestingMultiverse()
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		m.FuzzyNameSearch("asheok", 15)
	}
}

func BenchmarkMultiplePartialWordFuzzyNameSearch(b *testing.B) {
	m := openTestingMultiverse()
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		m.FuzzyNameSearch("ava me", 15)
	}
}

func BenchmarkSingleLetterFuzzyNameSearch(b *testing.B) {
	m := openTestingMultiverse()
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		m.FuzzyNameSearch("d", 15)
	}
}

func BenchmarkFullNameFuzzyNameSearch(b *testing.B) {
	m := openTestingMultiverse()
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		m.FuzzyNameSearch("Might of Old Krosa", 15)
	}
}
{'fraction_non_alphanumeric': 0.16063548102383055, 'fraction_numerical': 0.011915269196822596, 'mean_word_length': 4.502427184466019, 'pattern_counts': {'":': 0, '<': 10, '<?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': '3193692', 'n_tokens_mistral': 955, 'n_tokens_neox': 880, 'n_words': 187}