<commit_before># Method that we have on enumeration types.
my role Enumeration {
    has $.key;
    
    method perl() {
        self.defined ??
            (self.^name ~ '::' ~ $!key) !!
            self.^name;
    }
}

# Methods that we also have if the base type of an enumeration is
# Numeric.
my role NumericEnumeration {
}<commit_msg>A couple more methods in Enumeration/NumericEnumeration.<commit_after># Method that we have on enumeration types.
my role Enumeration {
    has $.key;
    
    multi method gist(::?CLASS:D:) {
        self.^name ~ '::' ~ $!key
    }
    
    method perl() {
        self.defined ??
            (self.^name ~ '::' ~ $!key) !!
            self.^name;
    }
}

# Methods that we also have if the base type of an enumeration is
# Numeric.
my role NumericEnumeration {
    multi method Str(::?CLASS:D:) {
        self.key
    }
}
{'fraction_non_alphanumeric': 0.1261574074074074, 'fraction_numerical': 0.0, 'mean_word_length': 2.1918819188191883, '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': '4976124', 'n_tokens_mistral': 285, 'n_tokens_neox': 272, 'n_words': 86}