<commit_before>package extension

import (
	"github.com/kayex/sirius"
	"github.com/kayex/sirius/text"
)

type Censor struct{}

func (*Censor) Run(m sirius.Message, cfg sirius.ExtensionConfig) (sirius.MessageAction, error) {
	strict := cfg.Boolean("strict")
	phrases := cfg.List("phrases")

	edit := m.EditText()

	for _, p := range phrases {
		if !m.Query(text.Lower(text.Word(p))) {
			continue
		}

		if strict {
			edit.Set(text.Code("CENSORED"))
			break
		}

		if cfg.Boolean("strike") {<commit_msg>Use IWord in censor extension<commit_after>package extension

import (
	"github.com/kayex/sirius"
	"github.com/kayex/sirius/text"
)

type Censor struct{}

func (*Censor) Run(m sirius.Message, cfg sirius.ExtensionConfig) (sirius.MessageAction, error) {
	strict := cfg.Boolean("strict")
	phrases := cfg.List("phrases")

	edit := m.EditText()

	for _, p := range phrases {
		if !m.Query(text.IWord(p)) {
			continue
		}

		if strict {
			edit.Set(text.Code("CENSORED"))
			break
		}

		if cfg.Boolean("strike") {
{'fraction_non_alphanumeric': 0.15893385982230998, 'fraction_numerical': 0.0, 'mean_word_length': 4.01980198019802, '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': '467295', 'n_tokens_mistral': 418, 'n_tokens_neox': 383, 'n_words': 74}