<commit_before>// Package generator downloads an updated version of the PSL list and compiles it into go code.
//
// It is meant to be used by maintainers in conjunction with the go generate tool
// to update the list.
package generator

import (
	"bytes"
	"context"
	"fmt"
	"go/format"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"strings"
	"text/template"
	"time"

	"github.com/google/go-github/github"
	"github.com/weppos/publicsuffix-go/publicsuffix"
)

const (
	// where the rules will be written
	filename = "rules.go"

	list = `// This file is automatically generated
// Run "go run cmd/gen/gen.go" to update the list.

package publicsuffix

const defaultListVersion = "PSL version {{.VersionSHA}} ({{.VersionDate}})"

func DefaultRules() [{{len .Rules}}]Rule {
	return r
}

var r = [{{len .Rules}}]Rule{
	{{range $r := .Rules}} \
	{ {{$r.Type}}, "{{$r.Value}}", {{$r.Length}}, {{$r.Private}} },
	{{end}}
}

func init() {
	for i := range r {
		DefaultList.AddRule(&r[i])<commit_msg>Remove unused constant<commit_after>// Package generator downloads an updated version of the PSL list and compiles it into go code.
//
// It is meant to be used by maintainers in conjunction with the go generate tool
// to update the list.
package generator

import (
	"bytes"
	"context"
	"fmt"
	"go/format"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"strings"
	"text/template"
	"time"

	"github.com/google/go-github/github"
	"github.com/weppos/publicsuffix-go/publicsuffix"
)

const (
	list = `// This file is automatically generated
// Run "go run cmd/gen/gen.go" to update the list.

package publicsuffix

const defaultListVersion = "PSL version {{.VersionSHA}} ({{.VersionDate}})"

func DefaultRules() [{{len .Rules}}]Rule {
	return r
}

var r = [{{len .Rules}}]Rule{
	{{range $r := .Rules}} \
	{ {{$r.Type}}, "{{$r.Value}}", {{$r.Length}}, {{$r.Private}} },
	{{end}}
}

func init() {
	for i := range r {
		DefaultList.AddRule(&r[i])
{'fraction_non_alphanumeric': 0.17110067814293167, 'fraction_numerical': 0.0, 'mean_word_length': 3.759305210918114, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '867177', 'n_tokens_mistral': 704, 'n_tokens_neox': 688, 'n_words': 209}