Skip to content

Normalize the ordinal "ninth" to "9th" - #2805

Open
iammcoding wants to merge 2 commits into
openai:mainfrom
iammcoding:fix-ninth-ordinal
Open

Normalize the ordinal "ninth" to "9th"#2805
iammcoding wants to merge 2 commits into
openai:mainfrom
iammcoding:fix-ninth-ordinal

Conversation

@iammcoding

Copy link
Copy Markdown

The English number normalizer builds ordinal words by adding "th" to the cardinal word, with a few hardcoded exceptions (first, second, third, fifth, eighth, twelfth). "nine" was missing from those exceptions, so the rule produced "nineth", which nobody writes, and the real word "ninth" was never recognized.

As a result "ninth" was left as text instead of "9th", and compound ordinals broke: "twenty ninth" came out as "20 ninth" and "one hundred and ninth" as "100 and ninth".

Added "ninth" to the hardcoded ordinals and excluded 9 from the generated rule. Added tests for the simple and compound cases.

iammcoding and others added 2 commits July 2, 2026 15:21
The English number normalizer builds ordinal words by adding "th" to the
cardinal word, with a few hardcoded exceptions (first, second, third,
fifth, eighth, twelfth). "nine" was missing from those exceptions, so the
rule produced "nineth", which nobody writes, and the real word "ninth"
was never recognized.

As a result "ninth" was left as text instead of "9th", and compound
ordinals broke: "twenty ninth" came out as "20 ninth" and "one hundred
and ninth" as "100 and ninth".

Added "ninth" to the hardcoded ordinals and excluded 9 from the generated
rule. Added tests for the simple and compound cases.
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