Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewilliami committed Jan 13, 2021
2 parents 7eec446 + ea1993b commit bb4c0ab
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/en.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function spelled_out_en(number::Integer; british::Bool = false, dict::Symbol = :

number = abs(number)
if number > limit - 1
throw(error("SpelledOut.jl does not support numbers larger than $(spelled_out_en(limit - 1, british=true)). Sorry about that!"))
throw(error("SpelledOut.jl does not support numbers larger than $(limit_str). Sorry about that!"))
end

if number < 100
Expand Down
1 change: 1 addition & 0 deletions src/en/standard_dictionary_numbers_extended.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ const _scale_traditional_european = String[
]

const limit = BigInt(big(10)^120)
const limit_str = "10^120"
3 changes: 3 additions & 0 deletions src/ru.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function spelled_out_ru(number::Number)

end
72 changes: 72 additions & 0 deletions src/ru/standard_dictionary_numbers.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
_ones_feminine = Dict{Int, NTuple{1, String}}(
1 => ("одна",),
2 => ("две",),
3 => ("три",),
4 => ("четыре",),
5 => ("пять",),
6 => ("шесть",),
7 => ("семь",),
8 => ("восемь",),
9 => ("девять",),
)

_ones = Dict{Int, NTuple{1, String}}(
1 => ("один",),
2 => ("два",),
3 => ("три",),
4 => ("четыре",),
5 => ("пять",),
6 => ("шесть",),
7 => ("семь",),
8 => ("восемь",),
9 => ("девять",),
)

_tens = Dict{Int, NTuple{1, String}}(
0 => ("десять",),
1 => ("одиннадцать",),
2 => ("двенадцать",),
3 => ("тринадцать",),
4 => ("четырнадцать",),
5 => ("пятнадцать",),
6 => ("шестнадцать",),
7 => ("семнадцать",),
8 => ("восемнадцать",),
9 => ("девятнадцать",),
)

_twenties = Dict{Int, NTuple{1, String}}(
2 => ("двадцать",),
3 => ("тридцать",),
4 => ("сорок",),
5 => ("пятьдесят",),
6 => ("шестьдесят",),
7 => ("семьдесят",),
8 => ("восемьдесят",),
9 => ("девяносто",),
)

_hundreds = Dict{Int, NTuple{1, String}}(
1 => ("сто",),
2 => ("двести",),
3 => ("триста",),
4 => ("четыреста",),
5 => ("пятьсот",),
6 => ("шестьсот",),
7 => ("семьсот",),
8 => ("восемьсот",),
9 => ("девятьсот",),
)

_thousands = Dict{Int, NTuple{3, String}}(
1 => ("тысяча", "тысячи", "тысяч"), # 10^3
2 => ("миллион", "миллиона", "миллионов"), # 10^6
3 => ("миллиард", "миллиарда", "миллиардов"), # 10^9
4 => ("триллион", "триллиона", "триллионов"), # 10^12
5 => ("квадриллион", "квадриллиона", "квадриллионов"), # 10^15
6 => ("квинтиллион", "квинтиллиона", "квинтиллионов"), # 10^18
7 => ("секстиллион", "секстиллиона", "секстиллионов"), # 10^21
8 => ("септиллион", "септиллиона", "септиллионов"), # 10^24
9 => ("октиллион", "октиллиона", "октиллионов"), # 10^27
10 => ("нониллион", "нониллиона", "нониллионов"), # 10^30
)

0 comments on commit bb4c0ab

Please sign in to comment.