<commit_before>declaration template pan/legacy;

type legacy_binary_affirmation_string = string with match(SELF, "^(yes|no)$");<commit_msg>Add a transitional type to allow components to migrate to real booleans<commit_after>declaration template pan/legacy;

type legacy_binary_affirmation_string = string with match(SELF, "^(yes|no)$");

function is_yes_no_true_false = {
    v = ARGV[0];
    if (is_boolean(v)) return(true);
    if (is_string(v) && match(v, "^(yes|no)$")) {
        deprecated(0, 'Legacy yes/no value in use, please migrate to true/false.');
        return(true);
    };
    false;
};

type transitional_yes_no_true_false = property with is_yes_no_true_false(SELF);
{'fraction_non_alphanumeric': 0.1259150805270864, 'fraction_numerical': 0.0029282576866764276, 'mean_word_length': 5.162162162162162, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1946654', 'n_tokens_mistral': 235, 'n_tokens_neox': 225, 'n_words': 56}