From c368d45abb3b74ccb7608c9fbbc1bcbbba513a94 Mon Sep 17 00:00:00 2001 From: Julia Glaszka <85160468+jglaszka@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:35:38 +0100 Subject: [PATCH] =?UTF-8?q?Add=20Slovene=20support=20=F0=9F=87=B8?= =?UTF-8?q?=F0=9F=87=AE=20(#134)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added slovene support * update README.md * updated long values * updated long values * removed unused imports * updated test cases * corrected tests * renamed methods in SlovenePluralForms' --- README.md | 1 + .../finance/tradukisto/MoneyConverters.java | 2 + .../finance/tradukisto/ValueConverters.java | 1 + .../tradukisto/internal/Container.java | 20 ++- .../languages/SlovenePluralForms.java | 51 ++++++ .../SloveneThousandToWordsConverter.java | 45 +++++ .../languages/slovene/SloveneValues.java | 78 +++++++++ .../tradukisto/MoneyConvertersTest.groovy | 2 + .../tradukisto/ValueConvertersTest.groovy | 4 + .../slovene/SloveneValuesTest.groovy | 154 ++++++++++++++++++ 10 files changed, 356 insertions(+), 2 deletions(-) create mode 100644 src/main/java/pl/allegro/finance/tradukisto/internal/languages/SlovenePluralForms.java create mode 100644 src/main/java/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneThousandToWordsConverter.java create mode 100644 src/main/java/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneValues.java create mode 100644 src/test/groovy/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneValuesTest.groovy diff --git a/README.md b/README.md index e44eb9ea..21857216 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ With Tradukisto, you can now transform numbers into their word equivalents easy * 🇷🇸 Serbian (Cyrillic) * 🇷🇸 Serbian (Latin) * 🇸🇰 Slovak +* 🇸🇮 Slovene / Slovenian * 🇪🇸 Spanish * 🇸🇪 Swedish * 🇹🇷 Turkish diff --git a/src/main/java/pl/allegro/finance/tradukisto/MoneyConverters.java b/src/main/java/pl/allegro/finance/tradukisto/MoneyConverters.java index c7d45793..cbec2675 100644 --- a/src/main/java/pl/allegro/finance/tradukisto/MoneyConverters.java +++ b/src/main/java/pl/allegro/finance/tradukisto/MoneyConverters.java @@ -21,6 +21,7 @@ import static pl.allegro.finance.tradukisto.internal.Container.serbianCyrillicContainer; import static pl.allegro.finance.tradukisto.internal.Container.serbianContainer; import static pl.allegro.finance.tradukisto.internal.Container.slovakContainer; +import static pl.allegro.finance.tradukisto.internal.Container.sloveneContainer; import static pl.allegro.finance.tradukisto.internal.Container.spanishContainer; import static pl.allegro.finance.tradukisto.internal.Container.swedishContainer; import static pl.allegro.finance.tradukisto.internal.Container.turkishContainer; @@ -46,6 +47,7 @@ public enum MoneyConverters { TURKISH_BANKING_MONEY_VALUE(turkishContainer().getBankingMoneyConverter()), SERBIAN_BANKING_MONEY_VALUE(serbianContainer().getBankingMoneyConverter()), SERBIAN_CYRILLIC_BANKING_MONEY_VALUE(serbianCyrillicContainer().getBankingMoneyConverter()), + SLOVENE_BANKING_MONEY_VALUE(sloveneContainer().getBankingMoneyConverter()), FRENCH_BANKING_MONEY_VALUE(frenchContainer().getBankingMoneyConverter()), BULGARIAN_BANKING_MONEY_VALUE(bulgarianContainer().getBankingMoneyConverter()), DUTCH_BANKING_MONEY_VALUE(dutchContainer().getBankingMoneyConverter()), diff --git a/src/main/java/pl/allegro/finance/tradukisto/ValueConverters.java b/src/main/java/pl/allegro/finance/tradukisto/ValueConverters.java index 893ee46e..bcd4d3cc 100644 --- a/src/main/java/pl/allegro/finance/tradukisto/ValueConverters.java +++ b/src/main/java/pl/allegro/finance/tradukisto/ValueConverters.java @@ -30,6 +30,7 @@ public enum ValueConverters { FRENCH_INTEGER(Container.frenchContainer().getIntegerConverter(), "fr"), TURKISH_INTEGER(Container.turkishContainer().getIntegerConverter(), "tr"), DUTCH_INTEGER(Container.dutchContainer().getIntegerConverter(), "nl"), + SLOVENE_INTEGER(Container.sloveneContainer().getIntegerConverter(), "sl"), SPANISH_INTEGER(Container.spanishContainer().getIntegerConverter(), "es"), HINDI_INTEGER(Container.hindiContainer().getIntegerConverter(), "hi"), SWEDISH_INTEGER(Container.swedishContainer().getIntegerConverter(), "sv"); diff --git a/src/main/java/pl/allegro/finance/tradukisto/internal/Container.java b/src/main/java/pl/allegro/finance/tradukisto/internal/Container.java index 4c95252b..7a0527ce 100644 --- a/src/main/java/pl/allegro/finance/tradukisto/internal/Container.java +++ b/src/main/java/pl/allegro/finance/tradukisto/internal/Container.java @@ -37,6 +37,8 @@ import pl.allegro.finance.tradukisto.internal.languages.serbian.SerbianValues; import pl.allegro.finance.tradukisto.internal.languages.slovak.SlovakValues; import pl.allegro.finance.tradukisto.internal.languages.slovak.SlovakValuesForSmallNumbers; +import pl.allegro.finance.tradukisto.internal.languages.slovene.SloveneThousandToWordsConverter; +import pl.allegro.finance.tradukisto.internal.languages.slovene.SloveneValues; import pl.allegro.finance.tradukisto.internal.languages.spanish.SpanishIntegerToWordsConverter; import pl.allegro.finance.tradukisto.internal.languages.spanish.SpanishIntegerToWordsConverterAdapter; import pl.allegro.finance.tradukisto.internal.languages.spanish.SpanishThousandToWordsConverter; @@ -93,6 +95,20 @@ public static Container croatianContainer() { return new Container(new CroatianValues()); } + public static Container sloveneContainer() { + SloveneValues values = new SloveneValues(); + + SloveneThousandToWordsConverter sloveneThousandToWordsConverter = new SloveneThousandToWordsConverter( + values.baseNumbers()); + + IntegerToStringConverter converter = new NumberToWordsConverter(sloveneThousandToWordsConverter, values.pluralForms()); + + BigDecimalToStringConverter bigDecimalBankingMoneyValueConverter = new BigDecimalToBankingMoneyConverter( + converter, values.currency()); + + return new Container(converter, null, bigDecimalBankingMoneyValueConverter); + } + public static Container czechContainer() { CzechValues czechValues = new CzechValues(); Container containerForBigNumbers = new Container(czechValues); @@ -250,7 +266,7 @@ public static Container hindiContainer() { return new Container(integerToStringConverter, longValueConverters, bigDecimalConverter); } - + public static Container spanishContainer() { SpanishValues values = new SpanishValues(); @@ -266,7 +282,7 @@ public static Container spanishContainer() { return new Container(converter, null, bigDecimalBankingMoneyValueConverter); } - + public static Container swedishContainer() { SwedishValues swedishBaseValues = new SwedishValues(); diff --git a/src/main/java/pl/allegro/finance/tradukisto/internal/languages/SlovenePluralForms.java b/src/main/java/pl/allegro/finance/tradukisto/internal/languages/SlovenePluralForms.java new file mode 100644 index 00000000..b6dae168 --- /dev/null +++ b/src/main/java/pl/allegro/finance/tradukisto/internal/languages/SlovenePluralForms.java @@ -0,0 +1,51 @@ +package pl.allegro.finance.tradukisto.internal.languages; + +import pl.allegro.finance.tradukisto.internal.support.Range; + +public class SlovenePluralForms implements PluralForms { + private final String singularForm; + private final String dualForm; + private final String pluralForm; + private final String genitivePluralForm; + + private final GenderType genderType; + + public SlovenePluralForms(String singularForm, String dualForm, String pluralForm, String genitivePluralForm, GenderType genderType) { + this.singularForm = singularForm; + this.dualForm = dualForm; + this.pluralForm = pluralForm; + this.genitivePluralForm = genitivePluralForm; + this.genderType = genderType; + } + + @Override + public String formFor(Integer value) { + if (shouldUseSingularForm(value)) { + return singularForm; + } + if (shouldUseDualForm(value)) { + return dualForm; + } + if (shouldUsePluralForm(value)) { + return pluralForm; + } + return genitivePluralForm; + } + + private boolean shouldUseSingularForm(Integer value) { + return value == 1 || value % 100 == 1; + } + + private boolean shouldUseDualForm(Integer value) { + return value == 2 || value % 100 == 2; + } + + private boolean shouldUsePluralForm(Integer value) { + return Range.closed(3, 4).contains(value % 100); + } + + @Override + public GenderType genderType() { + return genderType; + } +} diff --git a/src/main/java/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneThousandToWordsConverter.java b/src/main/java/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneThousandToWordsConverter.java new file mode 100644 index 00000000..a04b51b5 --- /dev/null +++ b/src/main/java/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneThousandToWordsConverter.java @@ -0,0 +1,45 @@ +package pl.allegro.finance.tradukisto.internal.languages.slovene; + +import pl.allegro.finance.tradukisto.internal.GenderAwareIntegerToStringConverter; +import pl.allegro.finance.tradukisto.internal.languages.GenderForms; +import pl.allegro.finance.tradukisto.internal.languages.GenderType; +import pl.allegro.finance.tradukisto.internal.support.Range; + +import java.util.Map; + +import static java.lang.String.format; + +public class SloveneThousandToWordsConverter implements GenderAwareIntegerToStringConverter { + + private final Map baseValues; + + public SloveneThousandToWordsConverter(Map baseValues) { + this.baseValues = baseValues; + } + + @Override + public String asWords(Integer value, GenderType genderType) { + if (baseValues.containsKey(value)) { + return baseValues.get(value).formFor(genderType); + } + if (Range.closed(21, 99).contains(value)) { + return twoDigitsNumberAsString(value); + } + if (Range.closed(101, 999).contains(value)) { + return threeDigitsNumberAsString(value, genderType); + } + throw new IllegalArgumentException(format("Can't convert %d", value)); + } + + private String twoDigitsNumberAsString(Integer value) { + Integer units = value % 10; + Integer tens = value - units; + return format("%sin%s", asWords(units, GenderType.FEMININE), asWords(tens, GenderType.FEMININE)); + } + + private String threeDigitsNumberAsString(Integer value, GenderType genderType) { + Integer tensWithUnits = value % 100; + Integer hundreds = value - tensWithUnits; + return format("%s %s", asWords(hundreds, genderType), asWords(tensWithUnits, genderType)); + } +} diff --git a/src/main/java/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneValues.java b/src/main/java/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneValues.java new file mode 100644 index 00000000..c06c2de6 --- /dev/null +++ b/src/main/java/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneValues.java @@ -0,0 +1,78 @@ +package pl.allegro.finance.tradukisto.internal.languages.slovene; + +import pl.allegro.finance.tradukisto.internal.BaseValues; +import pl.allegro.finance.tradukisto.internal.languages.GenderForms; +import pl.allegro.finance.tradukisto.internal.languages.GenderType; +import pl.allegro.finance.tradukisto.internal.languages.PluralForms; +import pl.allegro.finance.tradukisto.internal.languages.SlovenePluralForms; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import static pl.allegro.finance.tradukisto.internal.languages.GenderForms.genderForms; +import static pl.allegro.finance.tradukisto.internal.support.BaseNumbersBuilder.baseNumbersBuilder; + +public class SloveneValues implements BaseValues { + @Override + public Map baseNumbers() { + return baseNumbersBuilder() + .put(0, "nič") + .put(1, genderForms("en", "ena", "ena", "ena")) + .put(2, genderForms("dva", "dve", "dve", "dva")) + .put(3, genderForms("trije", "tri", "tri", "tri")) + .put(4, genderForms("štirije", "štiri", "štiri", "štiri")) + .put(5, "pet") + .put(6, "šest") + .put(7, "sedem") + .put(8, "osem") + .put(9, "devet") + .put(10, "deset") + .put(11, "enajst") + .put(12, "dvanajst") + .put(13, "trinajst") + .put(14, "štirinajst") + .put(15, "petnajst") + .put(16, "šestnajst") + .put(17, "sedemnajst") + .put(18, "osemnajst") + .put(19, "devetnajst") + .put(20, "dvajset") + .put(30, "trideset") + .put(40, "štirideset") + .put(50, "petdeset") + .put(60, "šestdeset") + .put(70, "sedemdeset") + .put(80, "osemdeset") + .put(90, "devetdeset") + .put(100, "sto") + .put(200, "dvesto") + .put(300, "tristo") + .put(400, "štiristo") + .put(500, "petsto") + .put(600, "šeststo") + .put(700, "sedemsto") + .put(800, "osemsto") + .put(900, "devetsto") + .build(); + } + + @Override + public List pluralForms() { + return Arrays.asList( + new SlovenePluralForms("", "", "", "", GenderType.FEMININE), + new SlovenePluralForms("tisoč", "tisoč", "tisoč", "tisoč", GenderType.NEUTER), + new SlovenePluralForms("milijon", "milijona", "milijone", "milijonov", GenderType.MASCULINE), + new SlovenePluralForms("milijarda", "milijardi", "milijarde", "milijard", GenderType.FEMININE)); + } + + @Override + public String currency() { + return "€"; + } + + @Override + public char twoDigitsNumberSeparator() { + return ' '; + } +} diff --git a/src/test/groovy/pl/allegro/finance/tradukisto/MoneyConvertersTest.groovy b/src/test/groovy/pl/allegro/finance/tradukisto/MoneyConvertersTest.groovy index 01d5ae51..04e4440e 100644 --- a/src/test/groovy/pl/allegro/finance/tradukisto/MoneyConvertersTest.groovy +++ b/src/test/groovy/pl/allegro/finance/tradukisto/MoneyConvertersTest.groovy @@ -21,6 +21,7 @@ import static pl.allegro.finance.tradukisto.MoneyConverters.SERBIAN_CYRILLIC_BAN import static pl.allegro.finance.tradukisto.MoneyConverters.SLOVAK_BANKING_MONEY_VALUE import static pl.allegro.finance.tradukisto.MoneyConverters.SPANISH_BANKING_MONEY_VALUE import static pl.allegro.finance.tradukisto.MoneyConverters.SWEDISH_BANKING_MONEY_VALUE +import static pl.allegro.finance.tradukisto.MoneyConverters.SLOVENE_BANKING_MONEY_VALUE import static pl.allegro.finance.tradukisto.MoneyConverters.TURKISH_BANKING_MONEY_VALUE import static pl.allegro.finance.tradukisto.MoneyConverters.UKRAINIAN_BANKING_MONEY_VALUE import static pl.allegro.finance.tradukisto.MoneyConverters.DUTCH_BANKING_MONEY_VALUE @@ -49,6 +50,7 @@ class MoneyConvertersTest extends Specification { "Serbian Cyrillic" | SERBIAN_CYRILLIC_BANKING_MONEY_VALUE || "једна хиљада двеста тридесет четири РСД 56/100" "Serbian Latin" | SERBIAN_BANKING_MONEY_VALUE || "jedna hiljada dvesta trideset četiri RSD 56/100" "Slovak" | SLOVAK_BANKING_MONEY_VALUE || "jeden tisíc dvesto tridsať štyri € 56/100" + "Slovene" | SLOVENE_BANKING_MONEY_VALUE || "ena tisoč dvesto štiriintrideset € 56/100" "Spanish" | SPANISH_BANKING_MONEY_VALUE || "mil doscientos treinta y cuatro € 56/100" "Russian" | RUSSIAN_BANKING_MONEY_VALUE || "одна тысяча двести тридцать четыре руб. 56/100" "Swedish" | SWEDISH_BANKING_MONEY_VALUE || "ett tusen två hundra och trettiofyra kr 56/100" diff --git a/src/test/groovy/pl/allegro/finance/tradukisto/ValueConvertersTest.groovy b/src/test/groovy/pl/allegro/finance/tradukisto/ValueConvertersTest.groovy index 80ee6692..4931f6a7 100644 --- a/src/test/groovy/pl/allegro/finance/tradukisto/ValueConvertersTest.groovy +++ b/src/test/groovy/pl/allegro/finance/tradukisto/ValueConvertersTest.groovy @@ -20,6 +20,7 @@ import static pl.allegro.finance.tradukisto.ValueConverters.SERBIAN_INTEGER import static pl.allegro.finance.tradukisto.ValueConverters.SLOVAK_INTEGER import static pl.allegro.finance.tradukisto.ValueConverters.SPANISH_INTEGER import static pl.allegro.finance.tradukisto.ValueConverters.SWEDISH_INTEGER +import static pl.allegro.finance.tradukisto.ValueConverters.SLOVENE_INTEGER import static pl.allegro.finance.tradukisto.ValueConverters.TURKISH_INTEGER import static pl.allegro.finance.tradukisto.ValueConverters.UKRAINIAN_INTEGER import static pl.allegro.finance.tradukisto.ValueConverters.DUTCH_INTEGER @@ -50,6 +51,7 @@ class ValueConvertersTest extends Specification { "Serbian Latin" | SERBIAN_INTEGER || "jedna hiljada dvesta trideset četiri" "Slovak" | SLOVAK_INTEGER || "jeden tisíc dvesto tridsať štyri" "Spanish" | SPANISH_INTEGER || "mil doscientos treinta y cuatro" + "Slovene" | SLOVENE_INTEGER || "ena tisoč dvesto štiriintrideset" "Russian" | RUSSIAN_INTEGER || "одна тысяча двести тридцать четыре" "Swedish" | SWEDISH_INTEGER || "ett tusen två hundra och trettiofyra" "Turkish" | TURKISH_INTEGER || "Bin İki Yüz Otuz Dört" @@ -94,6 +96,7 @@ class ValueConvertersTest extends Specification { new Locale("sr") || SERBIAN_INTEGER new Locale.Builder().setLanguage("sr").setScript("Latn").build() || SERBIAN_INTEGER new Locale("sk") || SLOVAK_INTEGER + new Locale("sl") || SLOVENE_INTEGER new Locale("es") || SPANISH_INTEGER new Locale("tr") || TURKISH_INTEGER new Locale("uk") || UKRAINIAN_INTEGER @@ -143,6 +146,7 @@ class ValueConvertersTest extends Specification { "sr" || SERBIAN_INTEGER "sr__#Latn" || SERBIAN_INTEGER "sk" || SLOVAK_INTEGER + "sl" || SLOVENE_INTEGER "es" || SPANISH_INTEGER "tr" || TURKISH_INTEGER "uk" || UKRAINIAN_INTEGER diff --git a/src/test/groovy/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneValuesTest.groovy b/src/test/groovy/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneValuesTest.groovy new file mode 100644 index 00000000..c98d7df4 --- /dev/null +++ b/src/test/groovy/pl/allegro/finance/tradukisto/internal/languages/slovene/SloveneValuesTest.groovy @@ -0,0 +1,154 @@ +package pl.allegro.finance.tradukisto.internal.languages.slovene + +import spock.lang.Ignore +import spock.lang.Specification +import spock.lang.Unroll + +import static pl.allegro.finance.tradukisto.internal.Container.sloveneContainer + +class SloveneValuesTest extends Specification { + + static intConverter = sloveneContainer().getIntegerConverter() + static longConverter = sloveneContainer().getLongConverter() + + @Unroll + def "should convert #value to '#words' in Slovene"() { + expect: + intConverter.asWords(value) == words + + where: + value | words + 0 | "nič" + 1 | "ena" + 2 | "dve" + 3 | "tri" + 4 | "štiri" + 5 | "pet" + 6 | "šest" + 7 | "sedem" + 8 | "osem" + 9 | "devet" + 11 | "enajst" + 12 | "dvanajst" + 13 | "trinajst" + 14 | "štirinajst" + 15 | "petnajst" + 16 | "šestnajst" + 17 | "sedemnajst" + 18 | "osemnajst" + 19 | "devetnajst" + 10 | "deset" + 20 | "dvajset" + 30 | "trideset" + 40 | "štirideset" + 50 | "petdeset" + 60 | "šestdeset" + 70 | "sedemdeset" + 80 | "osemdeset" + 90 | "devetdeset" + 21 | "enaindvajset" + 37 | "sedemintrideset" + 43 | "triinštirideset" + 58 | "oseminpetdeset" + 69 | "devetinšestdeset" + 76 | "šestinsedemdeset" + 82 | "dveinosemdeset" + 95 | "petindevetdeset" + 100 | "sto" + 200 | "dvesto" + 300 | "tristo" + 400 | "štiristo" + 500 | "petsto" + 600 | "šeststo" + 700 | "sedemsto" + 800 | "osemsto" + 900 | "devetsto" + 101 | "sto ena" + 111 | "sto enajst" + 272 | "dvesto dveinsedemdeset" + 387 | "tristo sedeminosemdeset" + 421 | "štiristo enaindvajset" + 448 | "štiristo oseminštirideset" + 569 | "petsto devetinšestdeset" + 625 | "šeststo petindvajset" + 782 | "sedemsto dveinosemdeset" + 895 | "osemsto petindevetdeset" + 999 | "devetsto devetindevetdeset" + 1_000 | "ena tisoč" + 2_000 | "dve tisoč" + 3_000 | "tri tisoč" + 4_000 | "štiri tisoč" + 5_000 | "pet tisoč" + 11_000 | "enajst tisoč" + 12_000 | "dvanajst tisoč" + 13_000 | "trinajst tisoč" + 14_000 | "štirinajst tisoč" + 15_000 | "petnajst tisoč" + 21_000 | "enaindvajset tisoč" + 7_634 | "sedem tisoč šeststo štiriintrideset" + 24_190 | "štiriindvajset tisoč sto devetdeset" + 99_999 | "devetindevetdeset tisoč devetsto devetindevetdeset" + 111_000 | "sto enajst tisoč" + 112_000 | "sto dvanajst tisoč" + 113_000 | "sto trinajst tisoč" + 115_000 | "sto petnajst tisoč" + 700_000 | "sedemsto tisoč" + 653_000 | "šeststo triinpetdeset tisoč" + 123_454 | "sto triindvajset tisoč štiristo štiriinpetdeset" + 999_999 | "devetsto devetindevetdeset tisoč devetsto devetindevetdeset" + 1_000_000 | "en milijon" + 2_000_000 | "dva milijona" + 3_000_000 | "trije milijone" + 4_000_000 | "štirije milijone" + 5_000_000 | "pet milijonov" + 6_000_000 | "šest milijonov" + 11_437_219 | "enajst milijonov štiristo sedemintrideset tisoč dvesto devetnajst" + 21_437_219 | "enaindvajset milijonov štiristo sedemintrideset tisoč dvesto devetnajst" + 22_437_219 | "dveindvajset milijonov štiristo sedemintrideset tisoč dvesto devetnajst" + 23_437_219 | "triindvajset milijonov štiristo sedemintrideset tisoč dvesto devetnajst" + 100_000_000 | "sto milijonov" + 121_000_000 | "sto enaindvajset milijonov" + 121_451_789 | "sto enaindvajset milijonov štiristo enainpetdeset tisoč sedemsto devetinosemdeset" + 123_456_789 | "sto triindvajset milijonov štiristo šestinpetdeset tisoč sedemsto devetinosemdeset" + 1_000_000_000 | "ena milijarda" + 2_141_123_731 | "dve milijardi sto enainštirideset milijonov sto triindvajset tisoč sedemsto enaintrideset" + Integer.MAX_VALUE | "dve milijardi sto sedeminštirideset milijonov štiristo triinosemdeset tisoč šeststo sedeminštirideset" + } + + @Ignore("Needs Slovene long converter") + @Unroll + def "should convert long #value to '#words' in Slovene"() { + expect: + longConverter.asWords(value) == words + + where: + value | words + 1_000_000_000 | "ena milijarda" + 2_000_000_000 | "dve milijardi" + 3_000_000_000 | "tri milijarde" + 4_000_000_000 | "štiri milijarde" + 5_000_000_000 | "pet milijard" + 14_000_000_000 | "štirinajst milijard" + + 1_000_000_000_000 | "en bilijon" + 2_000_000_000_000 | "dva bilijona" + 3_000_000_000_000 | "trije bilijoni" + 4_000_000_000_000 | "štirije bilijoni" + 5_000_000_000_000 | "pet bilijonov" + 14_000_000_000_000 | "štirinajst bilijonov" + + 1_000_000_000_000_000 | "ena bilijarda" + 2_000_000_000_000_000 | "dve bilijardi" + 3_000_000_000_000_000 | "tri bilijarde" + 4_000_000_000_000_000 | "štiri bilijarde" + 5_000_000_000_000_000 | "pet bilijard" + 14_000_000_000_000_000 | "štirinajst bilijard" + + 1_000_000_000_000_000_000 | "en trilijon" + 2_000_000_000_000_000_000 | "dva trilijona" + 3_000_000_000_000_000_000 | "trije trilijoni" + 4_000_000_000_000_000_000 | "štirije trilijoni" + 5_000_000_000_000_000_000 | "pet trilijonov" + Long.MAX_VALUE | "devet trilijonov dvjesto triindvajset bilijard tristo dvainsedemdeset bilijonov šestintrideset milijardi osamsto štiriinpedeset milijonov sedamsto petinsedemdeset tisoč sedeminosemsto" + } +}