roman-numerals - #1039
Open
kyellareddy wants to merge 4 commits into
Open
roman-numerals#1039kyellareddy wants to merge 4 commits into
kyellareddy wants to merge 4 commits into
Conversation
Looks up ZIP codes in the USA using uszip code, system, and us.
grzegorzkrukowski
requested changes
Sep 21, 2026
grzegorzkrukowski
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution!
There are a few things to fix before this can be merged:
Repository conventions
- File name: please use lowercase dash-case, e.g.
roman-numerals.py(see File naming convention). - Metadata: please add
@raycast.packageName Conversions(required in this repo) and a@raycast.description. - Location: this is a converter, so it belongs in
commands/conversions/next to scripts likehex-to-rgb.shandwhat-day-is.py. Theproductivityfolder is for tool-specific subfolders.
Behavior
- Invalid Roman numerals are accepted. The parser only checks that each character is a valid symbol, not that the sequence is well-formed. For example,
IIII→ 4,IC→ 99,VX→ 5,IIX→ 10,LL→ 100,MMMM→ 4000. One way to fix it is to convert the parsed number back withdecimalToRomanand reject the input if the round trip does not reproduce the original string. - Numbers above 3999 currently produce a long string of
Ms (try99999) and then read every one of them aloud. Since the script already knows the limit is 3999, it should just reject larger input. - Speech is unconditional. Every run shells out to
sayand blocks until it finishes, including on error paths. That is unexpected for a converter. I would either drop it, or make it opt-in with a dropdown argument (e.g.@raycast.argument2 { "type": "dropdown", "placeholder": "Speak", "optional": true, "data": [...] }).
Minor
value()can be a dict lookup.- "That is not a valid English numeral" → "That is not a valid number".
romanToDecimalreturns either anintor an error string. ReturningNoneon failure (or raising) would make the caller simpler.
Happy to take another look once these are addressed!
Enhance Roman numeral conversion with speaking option and input validation.
Contributor
Author
|
Done, I added a new commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Script command that takes any Roman numeral and outputs the equivalent in Arabic numerals (1, 2, 3, etc.).
Type of change
Screenshot
Video of it working:
Note that it also says out loud "XIV is equal to 14" at the same time that it shows in the toast.
598513825-15e2cddb-0c07-45e3-8a5a-66d056ebb8d2.mov
Dependencies / Requirements
Checklist