Skip to content

Conversation

@xdownedx
Copy link
Contributor

@xdownedx xdownedx commented May 12, 2025

This commit adds full support for the Armenian language to the num2words library with the following features: Complete implementation of cardinal numbers in Armenian; Support for ordinal numbers with appropriate suffixes; Support for years with special cases handling; Currency support for multiple currencies including AMD, EUR, USD and others; Proper pluralization rules for Armenian nouns; Modern numeral representation using Arabic digits; Comprehensive test suite to ensure correctness. The implementation follows Armenian grammar rules and provides correct pronunciation for all numeric forms.

Adding Armenian language support

Changes proposed in this pull request:

  • Add full implementation of Armenian language module (lang_HY.py)
  • Update init.py to register Armenian language
  • Add comprehensive test suite for Armenian language (test_hy.py)
  • Implement proper pluralization rules for Armenian nouns
  • Add special handling for years and currency formatting

Status

  • READY
  • HOLD
  • WIP (Work-In-Progress)

How to verify this change

Run the tests for Armenian language with python -m pytest tests/test_hy.py -v to verify all functionality. You can also manually test with examples like:

from num2words import num2words
print(num2words(42, lang='hy'))  # քառասուն երկու
print(num2words(42, lang='hy', to='ordinal'))  # քառասուն երկրորդ
print(num2words(1.5, lang='hy', to='currency', currency='USD'))  # մեկ դոլար ամբողջ հինգ տասներորդ ցենտ
print(num2words(2020, lang='hy', to='year'))  # երկու հազար քսան թվական

Additional notes

The implementation follows modern Armenian (Eastern Armenian) grammar rules and provides support for all standard num2words features. Currency support includes major international currencies with proper Armenian naming conventions.

xdownedx added 2 commits May 12, 2025 14:27
This commit adds full support for the Armenian language to the num2words library with the following features: Complete implementation of cardinal numbers in Armenian; Support for ordinal numbers with appropriate suffixes; Support for years with special cases handling; Currency support for multiple currencies including AMD, EUR, USD and others; Proper pluralization rules for Armenian nouns; Modern numeral representation using Arabic digits; Comprehensive test suite to ensure correctness. The implementation follows Armenian grammar rules and provides correct pronunciation for all numeric forms.
@mrodriguezg1991
Copy link
Contributor

Hello @xdownedx
Thanks for contributing to the project.
Please can you fix the linting and sorting issue in order to review the PR, thanks

@xdownedx
Copy link
Contributor Author

Hello @xdownedx Thanks for contributing to the project. Please can you fix the linting and sorting issue in order to review the PR, thanks

ready

@coveralls
Copy link

coveralls commented May 12, 2025

Coverage Status

coverage: 98.189% (+0.07%) from 98.118%
when pulling 65e391b on xdownedx:master
into 46c9580 on savoirfairelinux:master.

@xdownedx
Copy link
Contributor Author

@mrodriguezg1991 hey, please check my pr

@xdownedx
Copy link
Contributor Author

@mrodriguezg1991 can you review my pr?

@mrodriguezg1991 mrodriguezg1991 merged commit 07814cb into savoirfairelinux:master May 30, 2025
14 checks passed
@mrodriguezg1991
Copy link
Contributor

@mrodriguezg1991 can you review my pr?

Done, sorry for the delay, There will be a release , some point next week
Thanks for contributing

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.

3 participants