You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to add support for converting ordinal numbers to cardinal numbers in Spanish, similar to the existing ord2card function for English. However, Spanish has some particular rules, and I’d love some guidance on the best way to implement this.
Challenges & Questions
Handling suffixes: Spanish ordinals often end in "-avo", "-ésimo", or "-mo", but there are exceptions like "primero" → "uno", "tercero" → "tres". Any recommendations on edge cases?
Compound ordinals: How should we handle numbers like "vigésimo quinto" → 25 or "centésimo quincuagésimo tercero" → 153? Should we split the words and sum the values?
Existing approaches: Are there any existing conventions or resources for number normalization in Spanish that we could leverage?
Next Steps
Define a clear rule set for Spanish ordinals.
Implement a first version based on feedback.
Write tests to cover different cases.
I’d really appreciate any insights or suggestions before I start coding. Thanks in advance! 🙌
The text was updated successfully, but these errors were encountered:
Unfortunately the base algorithm used in this Python version of text2num is unable to handle ordinals where all the component are suffixed because it considers the suffix as an end-of-number marker.
Oh, I see! That makes a lot of sense. Thanks for the explanation and for sharing the Rust implementation—I’ll definitely check out the tests to better understand the new approach.
I’m not very experienced with Rust, so I think the best way for me to contribute in the short term would be by working on tests. Is there anything specific you'd like help with in that area? I'd be happy to assist with test cases, validating edge cases, or improving coverage.
Also, I’m very interested in contributing to the new Python features once the bindings are available. Please let me know how I can get involved when that happens!
I want to add support for converting ordinal numbers to cardinal numbers in Spanish, similar to the existing
ord2card
function for English. However, Spanish has some particular rules, and I’d love some guidance on the best way to implement this.Challenges & Questions
"-avo"
,"-ésimo"
, or"-mo"
, but there are exceptions like"primero"
→"uno"
,"tercero"
→"tres"
. Any recommendations on edge cases?"vigésimo quinto"
→25
or"centésimo quincuagésimo tercero"
→153
? Should we split the words and sum the values?Next Steps
I’d really appreciate any insights or suggestions before I start coding. Thanks in advance! 🙌
The text was updated successfully, but these errors were encountered: