<commit_before>package color

type Color int

const (
	Unknown Color = iota
	Empty
	White
	Black
)

func (color Color) String() string {
	switch color {
	case Empty:
		return "Empty"
	case White:
		return "White"
	case Black:
		return "Black"
	default:
		return "Unknown"
	}
}

func (color Color) Enemy() Color {
	switch color {
	case White:
		return Black
	case Black:
		return White
	default:
		return color
	}
}

func WhichColor(c byte) Color {
	if 'A' <= c && c <= 'Z' {
		return White
	} else if 'a' <= c && c <= 'z' {
		return Black
	} else if c == ' ' {
		return Empty
	} else {
		return Unknown
	}
}<commit_msg>Implement color parser<commit_after>package color

import "strings"

type Color int

const (
	Unknown Color = iota
	Empty
	White
	Black
)

func (color Color) String() string {
	switch color {
	case Empty:
		return "Empty"
	case White:
		return "White"
	case Black:
		return "Black"
	default:
		return "Unknown"
	}
}

func (color Color) Enemy() Color {
	switch color {
	case White:
		return Black
	case Black:
		return White
	default:
		return color
	}
}

func WhichColor(c byte) Color {
	if 'A' <= c && c <= 'Z' {
		return White
	} else if 'a' <= c && c <= 'z' {
		return Black
	} else if c == ' ' {
		return Empty
	} else {
		return Unknown
	}
}

func ParseColor(s string) Color {
	switch strings.ToLower(s) {
	case "white":
		return White
	case "black":
		return Black
	case "empty":
		return Empty
	default:
		return Unknown
	}
}
{'fraction_non_alphanumeric': 0.11509303928325293, 'fraction_numerical': 0.0, 'mean_word_length': 3.0672268907563027, 'pattern_counts': {'":': 3, '<': 11, '<?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': '1259685', 'n_tokens_mistral': 564, 'n_tokens_neox': 529, 'n_words': 183}