Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Norwegian uplift #484

Merged

Conversation

gealodge
Copy link

@gealodge gealodge commented Oct 5, 2022

Norwegian Uplift by gealodge

This may fix #110 but was not the motivation for the fix

Changes proposed in this pull request:

  • 'lang_NO.py':

    • Removed hyphen between tens and units (e.g. 92 should convert to nittito not nitti-to)
    • Fixed currency conversion (this was v broken)
    • Corrected ordinal_num (looks like this had not been changed from copying English)
    • removed comma from long word form numbers
  • 'test_no.py':

    • Created Norwegian test cases file with test cases

Status

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

How to verify this change

I have added hopefully quite comprehensive tests for the changes I have made and generally basic tests for Norwegian. Specific examples include:

>>> num2words('92', lang='no')
'nittito'
>>> num2words('1345', lang='no')
'en tusen tre hundre og førtifem'
>>> num2words('5', lang='no', to='ordinal')
'femte'
>>> num2words('5', lang='no', to='ordinal_num')
'5.'
>>> num2words('12', lang='no', to='currency')
'tolv kroner'

Additional notes

There were no tests, these needed adding. The currency conversion was completely broken, essentially dividing the numbers by 100 before converting. Hyphens and commas don't belong in Norwegian numbers like that, so I've removed them. I had to do a big shift around for the ordinals to get that working.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 96.968% when pulling f58d954 on gealodge:feature/NO_tens_units into 67146ed on savoirfairelinux:master.

@mrodriguezg1991 mrodriguezg1991 merged commit 7bcb5ab into savoirfairelinux:master Oct 18, 2022
@gealodge gealodge deleted the feature/NO_tens_units branch October 19, 2022 12:41
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.

Increment the test coverage for num2words/lang_NO.py
3 participants