<commit_before>package distVoteGen

import (
	"fmt"

	"github.com/marcuswestin/go-tp/gen/distVoteGen"
)

func Example() {
	err := run()
	if err != nil {
		panic(err)
	}
}

func run() (err error) {
	model := distVoteGen.NewModel(10)
	model.ProcessDocument("the cat sat on the mat")
	model.ProcessDocument("the cat hopes to see the hat")
	// model.PrintDistFreqs()
	model.Freeze()
	printSuggestions(model, "the cat")
	return
}

func printSuggestions(model *distVoteGen.Model, query string) {
	fmt.Println("Query:", query)
	suggestions := model.SuggestWord(query, 3)
	for _, suggestion := range suggestions {
		fmt.Println("\t", query, suggestion.String)
	}
}<commit_msg>fix distVoteGen_test<commit_after>package distVoteGen

import (
	"fmt"
	"testing"

	"github.com/marcuswestin/go-tp/gen/distVoteGen"
)

func TestExample(t *testing.T) {
	model := distVoteGen.NewModel(10)
	model.ProcessDocument("the cat sat on the mat")
	model.ProcessDocument("the cat hopes to see the hat")
	// model.PrintDistFreqs()
	model.Freeze()
	printSuggestions(model, "the cat")
}

func printSuggestions(model *distVoteGen.Model, query string) {
	fmt.Println("Query:", query)
	suggestions := model.SuggestWord(query, 3)
	for _, suggestion := range suggestions {
		fmt.Println("\t", query, suggestion.String)
	}
}
{'fraction_non_alphanumeric': 0.1414141414141414, 'fraction_numerical': 0.004662004662004662, 'mean_word_length': 4.962962962962963, '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': '1990842', 'n_tokens_mistral': 479, 'n_tokens_neox': 460, 'n_words': 102}