Alter the ordinal generation code for languages where it's not appropriate
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- localization
Research direction
Start by reading MathCat's ToOrdinal function and the explicitly written ordinals in Definitions.yaml. Compare the current tens-and-units fallback with the Italian examples, then check how ordinal rules vary across languages such as Spanish. Done means Italian compound ordinals work without 99 explicit entries while languages using composed ordinals retain their existing behavior.
Written by the indexing model from the issue text.
Description
MathCat's ToOrdinal function, currently, does the following, if I understand it right:
- takes a number and splits it into hundreds, tens and units
- for tens, it'll multiply the number by 10, and check the array length to see if it still fits in the explicitly written ordinals list. If it does not, it'll string together the tens as they are, and the ordinallized units. This doesn't work in languages such as Italian, where the whole word is ordinalized. For example:
- 21 = "ventuno", ordinal = "ventunesimo".
- 31 = "trentuno", ordinal = "trentunesimo".
- 55 = "cinquantacinque", ordinal = "cinquantacinquesimo".
So we need to change this mechanism, otherwise we would have a horrendous Definitions.yaml file with 99 explicit ordinals just to prevent MathCAT from falling back to the string together mechanism, which gives us "venti primo" for 21 (like the English "Twenty first", "Venti secondo", "Venti terzo", and so on.
In Italian,for example, the code would need to do the following:
For numbers 1 to 10, use an explicit dictionary.
After that, take the cardinal number, remove one letter and place "esimo" at the end. This becomes "esima" in case of feminine ordinals.
If the number ends with an E, remove it. If the E is accented like in 23 ("ventitré"), double it (e.g. "ventitré // Ventitreesimo", trentatré // trentatreesimo").
This does not translate similarly to other romance languages: Spanish, for example, has a system closely resembling English, where ordinals are composed (19 = "decimo noveno").
- Dominant language
- Rust
- Stars
- 114
- Forks
- 85
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 64
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from daisy/MathCAT
-
bug rules
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
discussion
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
discussion translation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement good first issue rules rust
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
discussion rules
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yantrikos/yantrik-os#255 ·
-
bug CLI custom-model
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
raphamorim/rio#1956 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 comment ·