Skip to content

Conversation

@NeonCarbide
Copy link

Add the ability to increment and decrement English shortform ordinals like 7th

  • Includes 0th
  • Properly detects -st, -nd, and -rd suffixes
  • Works with negative ordinals (-1st, -2nd, -3rd, ...)

@monaqa
Copy link
Owner

monaqa commented Nov 24, 2025

Thank you for the excellent PR!
I would love to incorporate it, but first let me discuss the implementation policy.

  • -1st does not necessarily represent negative ordinals.
    Rather, it is often used to represent hyphen ordinals, as in manuscript-1st.tex.
    I think it would be better to have an option to allow negative numbers, like the natural option in augend.integer.decimal.
  • Considering the above, instead of implementing it as an alias in misc.lua, I feel it would be better to create a new lua/dial/augend/ordinal.lua file and implement it there with natural option.

What do you think?

@NeonCarbide
Copy link
Author

NeonCarbide commented Nov 24, 2025

I agree to both your points.

In fact, I even tried to implement digit delimiters into the new augend but failed to do so and that resulted in the simplified implementation I submitted in this PR. This also somewhat explains my reasoning behind making it an alias under misc.lua as the whole augend honestly feels a little unfinished to me. Although, admittedly, this might be because the augend is just an alias and not its own thing. It would indeed be better to refactor it into a new augend, as it would also facilitate the creation of new aliases for other languages.

I truly appreciate all your input, as I find multiple perspectives extremely helpful. In the meantime, I shall convert this PR to a draft until the bulk of the refactoring is complete.

@NeonCarbide NeonCarbide marked this pull request as draft November 24, 2025 21:52
@NeonCarbide
Copy link
Author

NeonCarbide commented Nov 25, 2025

I have successfully managed to refactor the augend out of misc.lua and into its own type, as well as added the natural option that we had discussed previously. I've also added my query checking changes to the find_pattern functions from common.lua so that they may be used in other augends.

Additionally, I have added WARN comments regarding language-specific lines of code, as I wasn't able to figure out a way to generalize it without just passing it as a config value.

The only other things I feel are missing are digit delimiters and proper documentation regarding the new augend, but I feel like my doc-writing capabilities aren't quite up to snuff.

@NeonCarbide NeonCarbide marked this pull request as ready for review November 25, 2025 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants