Based off the ideas of several other questions on this site, your challenge is to write the most creative code in any program that takes as input a number written out in English and converts it to integer form.

Really dry, long and thorough specifications:

Your program will receive as input an integer in lowercase English between zero and nine hundred ninety-nine thousand nine hundred ninety-nine inclusive.

It must output only the integer form of the number between 0 and 999999 and nothing else (no whitespace).

The input will NOT contain , or and, as in one thousand, two hundred or five hundred and thirty-two.

When the tens and ones places are both nonzero and the tens place is greater than 1, they will be separated by a HYPHEN-MINUS character - instead of a space. Ditto for the ten thousands and thousands places. For example, six hundred fifty-four thousand three hundred twenty-one.

After one week, your answer is clearly in the lead at 74 votes, so I think that means that.. you win! By the way, mind if I use this code? It would be really useful for a lot of real-world projects I'm working on right now! ;)
–
AbrahamJul 1 '14 at 19:33

@Abraham Thanks! You're joking about using this in production code, right?
–
Digital TraumaJul 1 '14 at 22:15

Bash, 93 64 characters*

In the fantastic bsd-games package that's available on most Linux operating systems, there's a small command-line toy called number. It turns numbers into English text, that is, it does the exact opposite of this question. It really is the exact opposite: all the rules in the question are followed by number. It's almost too good to be a coincidence.

$ number 42
forty-two.

Of course, number doesn't answer the question. We want it the other way around. I thought about this for a while, tried string parsing and all that, then realised that I can just call number on all 999.999 numbers and see if something matches the input. If so, the first line where it matches has the line number I'm looking for. Simple as that. So, without further ado, here's the complete code for my entry:

seq 0 999999|number -l|sed '/\./d'|awk "/$1/ {print NR-1;exit}"

It even short-circuits, so converting "two" is quite fast, and even higher numbers are usually decoded in under a second on my box. Here's an example run:

Perl + CPAN

use feature 'say';
use Lingua::EN::Words2Nums;
say words2nums $_ while <>;

This program reads English strings from standard input (or from one or more files specified as command line arguments), one per line, and prints out the corresponding numbers to standard output.

I have tested this code using both the sample inputs from the challenge, as well as an exhaustive test suite consisting of the numbers from 0 to 999999 converted to text using the bsd-games number utility (thanks, Wander Nauta!), and it correctly parses all of them. As a bonus, it also understands such inputs as e.g. minus seven (−7), four and twenty (24), four score and seven (87), one gross (144), a baker's dozen (13), eleventy-one (111) and googol (10100).

VBScript 474

This is a fairly routine answer... unfortunately, so routine that @Snack pretty much posted the same process but before me.

i=split(REPLACE(REPLACE(inputbox(""),"lve","een"),"tho","k"))
o=split("z on tw th fo fi si se ei ni ten ele")
y=split("red *100) k )*1000 ty *10) een +10)")
z=""
p=0
for t=0 to UBOUND(i)
s=split(i(t),"-")
u=ubound(s)
r=s(0)
for x=0 to UBOUND(o)
IF INSTR(r,o(x)) THEN
z=z+"+"+CSTR(x)
END IF
IF u Then
IF INSTR(s(1),o(x)) THEN
z=z+CSTR(x)
END IF
END IF
next
for m=0 to UBOUND(y)
IF INSTR(r,y(m))AND u=0 THEN
z=z+y(m+1)
p=p+1
END IF
next
next
Execute("MSGBOX "+String(p,"(")+z)