@veronica I had the misfortune to code that in php about 18 years ago. And then have to update it when the site needed numbers above 4,999. And it's still in use.
@ptmcg Ah, nice. Not sure where I found the code I started from, but I remember modifying it a bit, and not even sure it was Python, although the principle is the same.
That function i posted is part of an app, and is used for labelling chapters and pages as Roman numerals.
@veronica That code is kind of old, and pre-dates the PEP8-ification of pyparsing's API. Also, after I created the railroad diagram for it, it seems like a very liberal parser, accepting any string combination of I's V's, X's, M's, etc. I have a stricter version parser almost ready.
Add comment