<commit_before>package dtf

import (
	"regexp"
)

var (
	year = "^[1-9][0-9]{3}$"

	yearAndMonth = "^[1-9][0-9]{3}-(1[0-2]|0[0-9])$"

	completeDate = "^[1-9][0-9]{3}-(1[0-2]|0[0-9])-([0-2][0-9]|3[0-1])$"

	withMinutes = "^[1-9][0-9]{3}-(1[0-2]|0[0-9])-([0-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]([-+]([01][0-9]|2[0-4])00|[A-Z]{3})$"

	withSeconds = "^[1-9][0-9]{3}-(1[0-2]|0[0-9])-([0-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([-+]([01][0-9]|2[0-4])00|[A-Z]{3})$"

	withFractionOfSecond = "^[1-9][0-9]{3}-(1[0-2]|0[0-9])-([0-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60).[0-9]+([-+]([01][0-9]|2[0-4])00|[A-Z]{3})$"
)

// IsYear check timeStr is 'YYYY'
func IsYear(timeStr string) bool {
	match, _ := regexp.MatchString(year, timeStr)
	return match
}

// IsYearAndMonth check timeStr is 'YYYY-MM'
func IsYearAndMonth(timeStr string) bool {
	match, _ := regexp.MatchString(yearAndMonth, timeStr)
	return match
}

// IsCompleteDate check timeStr is 'YYYY-MM-DD'
func IsCompleteDate(timeStr string) bool {
	match, _ := regexp.MatchString(completeDate, timeStr)
	return match
}

// IsCompleteDateWithMinutes check timeStr is 'YYYY-MM-DDThh:mmTZD'
func IsCompleteDateWithMinutes(timeStr string) bool {
	match, _ := regexp.MatchString(withMinutes, timeStr)
	return match
}

// IsCompleteDateWithSeconds check timeStr is 'YYYY-MM-DDThh:mm:ssTZD'
func IsCompleteDateWithSeconds(timeStr string) bool {
	match, _ := regexp.MatchString(withSeconds, timeStr)
	return match
}

// IsCompleteDateWithFractionOfSecond check timeStr is 'YYYY-MM-DDThh:mm:ss.sTZD'
func IsCompleteDateWithFractionOfSecond(timeStr string) bool {
	match, _ := regexp.MatchString(withFractionOfSecond, timeStr)
	return match
}<commit_msg>update pattern<commit_after>package dtf

import (
	"regexp"
)

var (
	timezone = "([-+]([01][0-9]|2[0-4])00|[A-Z]{3})"

	year = "[1-9][0-9]{3}"

	yearAndMonth = year + "-(1[0-2]|0[0-9])"

	completeDate = yearAndMonth + "-([0-2][0-9]|3[0-1])"

	hourMinutes = "([01][0-9]|2[0-3]):[0-5][0-9]"

	withMinutes = completeDate + "T" + hourMinutes + timezone

	withSeconds = completeDate + "T" + hourMinutes + ":([0-5][0-9]|60)" + timezone

	withFractionOfSecond = completeDate + "T" + hourMinutes + ":([0-5][0-9]|60).[0-9]+" + timezone
)

// IsYear check timeStr is 'YYYY'
func IsYear(timeStr string) bool {
	match, _ := regexp.MatchString("^"+year+"$", timeStr)
	return match
}

// IsYearAndMonth check timeStr is 'YYYY-MM'
func IsYearAndMonth(timeStr string) bool {
	match, _ := regexp.MatchString("^"+yearAndMonth+"$", timeStr)
	return match
}

// IsCompleteDate check timeStr is 'YYYY-MM-DD'
func IsCompleteDate(timeStr string) bool {
	match, _ := regexp.MatchString("^"+completeDate+"$", timeStr)
	return match
}

// IsCompleteDateWithMinutes check timeStr is 'YYYY-MM-DDThh:mmTZD'
func IsCompleteDateWithMinutes(timeStr string) bool {
	match, _ := regexp.MatchString("^"+withMinutes+"$", timeStr)
	return match
}

// IsCompleteDateWithSeconds check timeStr is 'YYYY-MM-DDThh:mm:ssTZD'
func IsCompleteDateWithSeconds(timeStr string) bool {
	match, _ := regexp.MatchString("^"+withSeconds+"$", timeStr)
	return match
}

// IsCompleteDateWithFractionOfSecond check timeStr is 'YYYY-MM-DDThh:mm:ss.sTZD'
func IsCompleteDateWithFractionOfSecond(timeStr string) bool {
	match, _ := regexp.MatchString("^"+withFractionOfSecond+"$", timeStr)
	return match
}
{'fraction_non_alphanumeric': 0.21907292589312075, 'fraction_numerical': 0.06436374372601122, 'mean_word_length': 5.344569288389513, 'pattern_counts': {'":': 2, '<': 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': '2677352', 'n_tokens_mistral': 1515, 'n_tokens_neox': 1466, 'n_words': 220}