Quick attempt at a validating roman numeral parser… Lots of gotchas.
Also see: Why Yahoo should say Yes to MicroSoft
Also see: Help John Baez and Mike Stay!
Got asked about a roman numeral parser during an interview. I have to say that I don’t mind when the process of obtaining employment plays into my strengths. The process was quite similar to a previous process where I wrote a spoken numerics converter. Not only that, there were many similar qualities to my int parsing routines. With that in mind I think I did fairly well. The goal at the time was to produce a routine to validate numbers up to roman numeral 30 or XXX. Didn’t take long, but in the end, I had left out many different validation techniques. I really wanted to revisit the problem since I had the code correctly written in my mind. Check the algorithms out, they should handle just about anything you can throw at them at this point. If you find issues, please feel free to submit your problems, since I’d love to solidfy things a bit more. Apparently roman numeral parsing has great application in reading dates.
Roman Numeral Parsing: Code Only: Bidirectional roman numeral parsing. [EDIT: Added alternate parsing routines and performance fixes]
Integer to Spoken Numerics: Code-Only: int/long/double conversion to Spoken Numerics
Phone Number to Words: Trying my hand at the old Phone number to Words teaser project!
Integer Parsing: DWC.Algorithms.NumberUtilities
http://weblogs.asp.net/justin_rogers/archive/2004/10/24/247032.aspx
