Convert English to a number without built-ins or libraries This challenge is similar to this other, however I made a restriction (see bold text below) that I think would made it much diffent and (I hope) fun either. 

The Challenge

Write a program or a function in any programming language that takes as input the English name of a positive integer n not exceeding 100 and returns n as an integer. 

Standard loopholes are forbidden and you cannot use any built-in function, external tool, or library that already does this job.

Shortest source code in bytes wins.

Test

Here all the input-&gt;output cases:

one              -&gt; 1
two              -&gt; 2
three            -&gt; 3
four             -&gt; 4
five             -&gt; 5
six              -&gt; 6
seven            -&gt; 7
eight            -&gt; 8
nine             -&gt; 9
ten              -&gt; 10
eleven           -&gt; 11
twelve           -&gt; 12
thirteen         -&gt; 13
fourteen         -&gt; 14
fifteen          -&gt; 15
sixteen          -&gt; 16
seventeen        -&gt; 17
eighteen         -&gt; 18
nineteen         -&gt; 19
twenty           -&gt; 20
twenty-one       -&gt; 21
twenty-two       -&gt; 22
twenty-three     -&gt; 23
twenty-four      -&gt; 24
twenty-five      -&gt; 25
twenty-six       -&gt; 26
twenty-seven     -&gt; 27
twenty-eight     -&gt; 28
twenty-nine      -&gt; 29
thirty           -&gt; 30
thirty-one       -&gt; 31
thirty-two       -&gt; 32
thirty-three     -&gt; 33
thirty-four      -&gt; 34
thirty-five      -&gt; 35
thirty-six       -&gt; 36
thirty-seven     -&gt; 37
thirty-eight     -&gt; 38
thirty-nine      -&gt; 39
forty            -&gt; 40
forty-one        -&gt; 41
forty-two        -&gt; 42
forty-three      -&gt; 43
forty-four       -&gt; 44
forty-five       -&gt; 45
forty-six        -&gt; 46
forty-seven      -&gt; 47
forty-eight      -&gt; 48
forty-nine       -&gt; 49
fifty            -&gt; 50
fifty-one        -&gt; 51
fifty-two        -&gt; 52
fifty-three      -&gt; 53
fifty-four       -&gt; 54
fifty-five       -&gt; 55
fifty-six        -&gt; 56
fifty-seven      -&gt; 57
fifty-eight      -&gt; 58
fifty-nine       -&gt; 59
sixty            -&gt; 60
sixty-one        -&gt; 61
sixty-two        -&gt; 62
sixty-three      -&gt; 63
sixty-four       -&gt; 64
sixty-five       -&gt; 65
sixty-six        -&gt; 66
sixty-seven      -&gt; 67
sixty-eight      -&gt; 68
sixty-nine       -&gt; 69
seventy          -&gt; 70
seventy-one      -&gt; 71
seventy-two      -&gt; 72
seventy-three    -&gt; 73
seventy-four     -&gt; 74
seventy-five     -&gt; 75
seventy-six      -&gt; 76
seventy-seven    -&gt; 77
seventy-eight    -&gt; 78
seventy-nine     -&gt; 79
eighty           -&gt; 80
eighty-one       -&gt; 81
eighty-two       -&gt; 82
eighty-three     -&gt; 83
eighty-four      -&gt; 84
eighty-five      -&gt; 85
eighty-six       -&gt; 86
eighty-seven     -&gt; 87
eighty-eight     -&gt; 88
eighty-nine      -&gt; 89
ninety           -&gt; 90
ninety-one       -&gt; 91
ninety-two       -&gt; 92
ninety-three     -&gt; 93
ninety-four      -&gt; 94
ninety-five      -&gt; 95
ninety-six       -&gt; 96
ninety-seven     -&gt; 97
ninety-eight     -&gt; 98
ninety-nine      -&gt; 99
one hundred      -&gt; 100
C, 160 bytes



g(char*s){char i=1,r=0,*p="k^[#&gt;Pcx.yI&lt;7CZpVgmH:o]sYK$2";for(;*s^'-'&amp;&amp;*s;r+=*s++|9);r=r%45+77;for(;*p!=r;p++,i++);return((*s^'-')?0:g(s+1))+(i&lt;21?i:10*(i-18));}


Test it

int main ()
{
    char* w[] = {"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven", "twenty-eight", "twenty-nine", "thirty", "thirty-one", "thirty-two", "thirty-three", "thirty-four", "thirty-five", "thirty-six", "thirty-seven", "thirty-eight", "thirty-nine", "forty", "forty-one", "forty-two", "forty-three", "forty-four", "forty-five", "forty-six", "forty-seven", "forty-eight", "forty-nine", "fifty", "fifty-one", "fifty-two", "fifty-three", "fifty-four", "fifty-five", "fifty-six", "fifty-seven", "fifty-eight", "fifty-nine", "sixty", "sixty-one", "sixty-two", "sixty-three", "sixty-four", "sixty-five", "sixty-six", "sixty-seven", "sixty-eight", "sixty-nine", "seventy", "seventy-one", "seventy-two", "seventy-three", "seventy-four", "seventy-five", "seventy-six", "seventy-seven", "seventy-eight", "seventy-nine", "eighty", "eighty-one", "eighty-two", "eighty-three", "eighty-four", "eighty-five", "eighty-six", "eighty-seven", "eighty-eight", "eighty-nine", "ninety", "ninety-one", "ninety-two", "ninety-three", "ninety-four", "ninety-five", "ninety-six", "ninety-seven", "ninety-eight", "ninety-nine", "one hundred"};

    int n;
    for (n = 1; n &lt;= 100; n++)
    {
        printf ("%s -&gt; %d\n", w[n], g(w[n]));
        if (n != g(w[n]))
        {
            printf ("Error at n = %d", n);
            return 1;
        }
    }
    return 0;
}


How it works

After some attempts, I found a function that maps the "exceptional" numbers one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety, one hundred, to the printable ASCII characters k, ., [, &lt;, *, , c, K, w, y, e, (, S, _, -, C, ), 7, =, 4, &amp;, o, ], s, Y, g, m, N, respectively.

This function is:

char hash (char* s)
{
    char r = 0;

    while (*s)
    {
        r += *s|9;
        s++;
    }

    return r%45+77;
}


The golfed program computes the hash function of the input until it reaches the end of the string or the character -. Then it searches the hash in the string k.[&lt;* cKwye(S_-C)7=4&amp;o]sYgmN and determines the corresponding number. If the end of the input string was reached the number is returned, if instead a - was reached, then it is returned the number plus the result of the golfed program applied to the rest of the input string.