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

[DE] all tens from 20 to 90 do not work #5

Closed
mib1185 opened this issue Nov 20, 2024 · 1 comment
Closed

[DE] all tens from 20 to 90 do not work #5

mib1185 opened this issue Nov 20, 2024 · 1 comment

Comments

@mib1185
Copy link

mib1185 commented Nov 20, 2024

In English this works perfect, but in German, the zero is always added to the tens (compared with English it would be "twenty-zero" instead of just "zwenty")

I've added some further tests to validate this and you see 21..29 are OK (20 is commented on purpose, to let the test fail at earliest on 30) but 30 results in "nullunddreißig" (thirty-zero) instead of "dreißig" (thirty)

    def test_german():
        engine = RbnfEngine.for_language("de")
        assert engine.format_number(1).text == "eins"
        assert engine.format_number(2).text == "zwei"
        assert engine.format_number(3).text == "drei"
        assert engine.format_number(4).text == "vier"
        assert engine.format_number(5).text == "fünf"
        assert engine.format_number(6).text == "sechs"
        assert engine.format_number(7).text == "sieben"
        assert engine.format_number(8).text == "acht"
        assert engine.format_number(9).text == "neun"
        assert engine.format_number(10).text == "zehn"
        assert engine.format_number(11).text == "elf"
        assert engine.format_number(12).text == "zwölf"
        assert engine.format_number(13).text == "dreizehn"
        assert engine.format_number(14).text == "vierzehn"
        assert engine.format_number(15).text == "fünfzehn"
        assert engine.format_number(16).text == "sechzehn"
        assert engine.format_number(17).text == "siebzehn"
        assert engine.format_number(18).text == "achtzehn"
        assert engine.format_number(19).text == "neunzehn"
        # assert engine.format_number(20).text == "zwanzig"
        assert engine.format_number(21).text == "einundzwanzig"
        assert engine.format_number(22).text == "zweiundzwanzig"
        assert engine.format_number(23).text == "dreiundzwanzig"
        assert engine.format_number(24).text == "vierundzwanzig"
        assert engine.format_number(25).text == "fünfundzwanzig"
        assert engine.format_number(26).text == "sechsundzwanzig"
        assert engine.format_number(27).text == "siebenundzwanzig"
        assert engine.format_number(28).text == "achtundzwanzig"
        assert engine.format_number(29).text == "neunundzwanzig"
>       assert engine.format_number(30).text == "dreißig"
E       AssertionError: assert 'nullunddreißig' == 'dreißig'
E         
E         
E         - dreißig
E         + nullunddreißig
@synesthesiam
Copy link
Contributor

Fixed in 2.2.0

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 a pull request may close this issue.

2 participants