<commit_before>// Copyright 2012 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package slug transforms strings into a normalized
// form well suited for use in URLs.
package slug

import (
	"exp/norm"
	"unicode"
)

var nop = []*unicode.RangeTable{unicode.Mark, unicode.Sk, unicode.Lm}

// Slug replaces each run of characters which are not unicode letters or
// numbers with a single hyphen, except for leading or trailing runs. Letters
// will be stripped of diacritical marks and lowercased.
func Slug(s string) string {
	buf := make([]rune, 0, len(s))
	dash := false
	for _, r := range norm.NFKD.String(s) {
		switch {
		//case r >= 'A' && r <= 'Z':
		//	r -= 'A'
		//	fallthrough
		// unicode 'letters' like mandarin characters pass through
		case unicode.IsLetter(r):
			r = unicode.ToLower(r)
			fallthrough
		case unicode.IsNumber(r):<commit_msg>Removed commented code<commit_after>// Copyright 2012 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package slug transforms strings into a normalized
// form well suited for use in URLs.
package slug

import (
	"exp/norm"
	"unicode"
)

var nop = []*unicode.RangeTable{unicode.Mark, unicode.Sk, unicode.Lm}

// Slug replaces each run of characters which are not unicode letters or
// numbers with a single hyphen, except for leading or trailing runs. Letters
// will be stripped of diacritical marks and lowercased.
func Slug(s string) string {
	buf := make([]rune, 0, len(s))
	dash := false
	for _, r := range norm.NFKD.String(s) {
		switch {
		// unicode 'letters' like mandarin characters pass through
		case unicode.IsLetter(r):
			r = unicode.ToLower(r)
			fallthrough
		case unicode.IsNumber(r):
{'fraction_non_alphanumeric': 0.10735694822888284, 'fraction_numerical': 0.005449591280653951, 'mean_word_length': 3.5445544554455446, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '4747392', 'n_tokens_mistral': 619, 'n_tokens_neox': 549, 'n_words': 231}