Once again I must graciously throw myself upon your collective wisdom for a solution to a problem. I am looking for a function or perhaps a regex that can take a spelled out number like 'first' and then convert it to '1st'. Initally this would seem to be easy but then interesting possibilities creep up. Many years ago in my lost C porgramming days I had an algorithm for just this tpye of thing, but now I can find no reference to it nor find something similar online. The reason for my frustration is a billing company I am interfacing with requires the addresses to replace spelled out numbers to numerical equivalents. Numbers after 10 rarely show up, but a quick check in our database reveals people entering addresses like:
The answer should then be 12308 13th Street.
If anyone knows of such an algorithm in perl I would appreciate it.
Akira the most humble in this regards.