<commit_before>wtn = {};

wtn.singles = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty"];

wtn.convert = function(input)
{
    var single = this.singles.indexOf(input.toLowerCase());
    if (single == -1)
    {
        var split = input.split(' ');
        if (split[0] == 'thirty')
            return this.singles.indexOf(split[1]) + 31;
        if (split[0] == 'forty')
            return this.singles.indexOf(split[1]) + 41;
        if (split[0] == 'fifty')
            return this.singles.indexOf(split[1]) + 51;
        if (split[0] == 'sixty')
            return this.singles.indexOf(split[1]) + 61;
        if (split[0] == 'seventy')
            return this.singles.indexOf(split[1]) + 71;
        if (split[0] == 'eighty')
            return this.singles.indexOf(split[1]) + 81;
        if (split[0] == 'ninety')
            return this.singles.indexOf(split[1]) + 91;
        return this.singles.indexOf(split[1]) + 21;
    }
    return single + 1;
}<commit_msg>Refactor.<commit_after>wtn = {};

wtn.singles = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty"];

wtn.tens = {
               'twenty': 20,
               'thirty': 30,
               'forty': 40,
               'fifty': 50,
               'sixty': 60,
               'seventy': 70,
               'eighty': 80,
               'ninety': 90
           };

wtn.convert = function(input)
{
    var single = this.singles.indexOf(input.toLowerCase());
    if (single == -1)
    {
        var split = input.split(' ');
        if (wtn.tens[split[0]] != undefined)
            return this.singles.indexOf(split[1]) + 1 + wtn.tens[split[0]];
    }
    return single + 1;
}
{'fraction_non_alphanumeric': 0.1995841995841996, 'fraction_numerical': 0.028586278586278588, 'mean_word_length': 2.30188679245283, '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': '1160673', 'n_tokens_mistral': 706, 'n_tokens_neox': 665, 'n_words': 141}