Skip to content

Help needed: Implementing ord2card in Spanish #121

@CarlosUriass

Description

@CarlosUriass

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

  1. 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?
  2. 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?
  3. 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! 🙌

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions