<commit_before>package main

import (
	"bufio"
	"compress/gzip"
	"errors"
	"fmt"
	"os"
	"os/exec"
	"os/user"
	"path/filepath"
	"regexp"
	"strings"
	"time"
	"unicode/utf8"
)

const delimiter string = "::::"

func fail(err error) {
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}
func failOn(b bool, message string) {
	if b {
		fail(errors.New(message))
	}
}

type Stack struct {
	s   []string
	dir string
}

func NewStack(capacity int) *Stack {
	s := make([]string, 0, capacity)
	return &Stack{s, ""}
}

func (s *Stack) Push(dirname string) {
	s.s = append(s.s, dirname)
	s.dir = filepath.Join(s.s...)
}

func (s *Stack) Pop() {
	failOn(len(s.s) <= 0, "Invalid directory state. Corrupted database?")
	i := len(s.s) - 1
	s.s = s.s[:i]
	s.dir = filepath.Join(s.s...)
}

func (s Stack) Dir() string {
	return s.dir
}

func keyval(line string) (string, string) {
	i := strings.Index(line, ":")
	if i == -1 || i == len(line)-1 {
		return line, ""
	}
	return line[:i], line[i+2:]
}

type Track struct {
	Album    string
	Artist   string
	Date     string
	Filename string
	Genre    string
	Path     string
	Time     string
	Title    string
}

func (t *Track) Set(key, value string) {
	switch key {
	case "Album":
		t.Album = value
	case "Artist":
		t.Artist = value
	case "Date":
		t.Date = value
	case "Genre":
		t.Genre = value
	case "Time":
		t.Time = formatDurationString(value)
	case "Title":
		t.Title = value
	default:
		panic("Unknown key: " + key)
	}
}
<commit_msg>Remove panic for unknown key<commit_after>package main

import (
	"bufio"
	"compress/gzip"
	"errors"
	"fmt"
	"os"
	"os/exec"
	"os/user"
	"path/filepath"
	"regexp"
	"strings"
	"time"
	"unicode/utf8"
)

const delimiter string = "::::"

func fail(err error) {
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}
func failOn(b bool, message string) {
	if b {
		fail(errors.New(message))
	}
}

type Stack struct {
	s   []string
	dir string
}

func NewStack(capacity int) *Stack {
	s := make([]string, 0, capacity)
	return &Stack{s, ""}
}

func (s *Stack) Push(dirname string) {
	s.s = append(s.s, dirname)
	s.dir = filepath.Join(s.s...)
}

func (s *Stack) Pop() {
	failOn(len(s.s) <= 0, "Invalid directory state. Corrupted database?")
	i := len(s.s) - 1
	s.s = s.s[:i]
	s.dir = filepath.Join(s.s...)
}

func (s Stack) Dir() string {
	return s.dir
}

func keyval(line string) (string, string) {
	i := strings.Index(line, ":")
	if i == -1 || i == len(line)-1 {
		return line, ""
	}
	return line[:i], line[i+2:]
}

type Track struct {
	Album    string
	Artist   string
	Date     string
	Filename string
	Genre    string
	Path     string
	Time     string
	Title    string
}

func (t *Track) Set(key, value string) {
	switch key {
	case "Album":
		t.Album = value
	case "Artist":
		t.Artist = value
	case "Date":
		t.Date = value
	case "Genre":
		t.Genre = value
	case "Time":
		t.Time = formatDurationString(value)
	case "Title":
		t.Title = value
	}
}

{'fraction_non_alphanumeric': 0.16825288919102652, 'fraction_numerical': 0.005438477226376614, 'mean_word_length': 3.1103351955307263, 'pattern_counts': {'":': 16, '<': 5, '<?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': '1136505', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1223, 'n_words': 318}