<commit_before>package shield

import (
	"testing"
)

var redis = "127.0.0.1:6379"

func TestLearn(t *testing.T) {
	store := NewRedisStore("127.0.0.1:6379", "", 0)
	tokenizer := NewEnglishTokenizer()
	sh := New(tokenizer, store)

	sh.Learn("good", "sunshine drugs love sex lobster sloth")
	sh.Learn("bad", "fear death horror government zombie god")

	c, err := sh.Classify("sloths are so cute i love them")
	if err != nil {
		t.Fatal(err)
	}
	if c != "good" {
		t.Fatal(c)
	}

	c, err = sh.Classify("i fear god and love the government")
	if err != nil {
		t.Fatal(err)<commit_msg>Var obsolete.<commit_after>package shield

import (
	"testing"
)

func TestLearn(t *testing.T) {
	store := NewRedisStore("127.0.0.1:6379", "", 0)
	tokenizer := NewEnglishTokenizer()
	sh := New(tokenizer, store)

	sh.Learn("good", "sunshine drugs love sex lobster sloth")
	sh.Learn("bad", "fear death horror government zombie god")

	c, err := sh.Classify("sloths are so cute i love them")
	if err != nil {
		t.Fatal(err)
	}
	if c != "good" {
		t.Fatal(c)
	}

	c, err = sh.Classify("i fear god and love the government")
	if err != nil {
		t.Fatal(err)
{'fraction_non_alphanumeric': 0.16283185840707964, 'fraction_numerical': 0.02831858407079646, 'mean_word_length': 3.896103896103896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3460985', 'n_tokens_mistral': 481, 'n_tokens_neox': 430, 'n_words': 121}