english words to numbers

Hello All,

is anyone knows of a function to convert english words to numbers?

For example:

"five" = 5

"twenty one" = 21

"twnty one" also should be 21

I've found plenty that convert numbers to words, but can't find any that convert words to numbers.

Thanks.

[309 byte] By [AndreiSha] at [2007-10-3 3:21:06]
# 1

There is no such function in the API of which I am aware.

The last conversion ("twnty one" -> 21) seems to be rather an excessive requirement; at that point, from what I gather, you want the function to correct user typos. I rather doubt that that'll be at all easy, although you can use a sort of "sounds-like" approach on the string (see http://en.wikipedia.org/wiki/Soundex) to try to match it to words you're willing to recognize.

tvynra at 2007-7-14 21:13:20 > top of Java-index,Java Essentials,Java Programming...