-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
431 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
et: | ||
numbers: | ||
ones: ["null", üks, kaks, kolm, neli, viis, kuus, seitse, kaheksa, üheksa] | ||
teens: [kümme, üksteist, kaksteist, kolmteist, neliteist, viisteist, kuusteist, seitseteist, kaheksateist, üheksateist] | ||
tens: ["null", kümme, kakskümmend, kolmkümmend, nelikümmend, viiskümmend, kuuskümmend, seitsekümmend, kaheksakümmend, üheksakümmend] | ||
mega: [ones, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions] | ||
hundreds: sada | ||
thousands: tuhat | ||
millions: | ||
one: miljon | ||
other: miljonit | ||
billions: | ||
one: miljard | ||
other: miljardit | ||
trillions: | ||
one: triljon | ||
other: triljonit | ||
quadrillions: | ||
one: kvadriljon | ||
other: kvadriljonit | ||
quintillions: | ||
one: kvintiljon | ||
other: kvintiljonit | ||
sextillions: | ||
one: sekstiljon | ||
other: sekstiljonit | ||
septillions: | ||
one: septiljon | ||
other: septiljonit | ||
octillions: | ||
one: oktiljon | ||
other: oktiljonit | ||
nonillions: | ||
one: noniljon | ||
other: noniljonit | ||
decillions: | ||
one: dekiljon | ||
other: dekiljonit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
lt: | ||
numbers: | ||
ones: [nulis, vienas, du, trys, keturi, penki, šeši, septyni, aštuoni, devyni] | ||
teens: [dešimt, vienuolika, dvylika, trylika, keturiolika, penkiolika, šešiolika, septyniolika, aštuoniolika, devyniolika] | ||
tens: [nulis, dešimt, dvidešimt, trisdešimt, keturiasdešimt, penkiasdešimt, šešiasdešimt, septyniasdešimt, aštuoniasdešimt, devyniasdešimt] | ||
mega: [ones, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions] | ||
hundreds: [šimtas, du šimtai, trys šimtai, keturi šimtai, penki šimtai, šeši šimtai, septyni šimtai, aštuoni šimtai, devyni šimtai] | ||
one_hundred: šimtas | ||
thousands: | ||
one: tūkstantis | ||
ones: tūkstančiai | ||
other: tūkstančių | ||
millions: | ||
one: milijonas | ||
ones: milijonai | ||
other: milijonø | ||
billions: | ||
one: bilijonas | ||
ones: bilijonai | ||
other: bilijonø | ||
trillions: | ||
one: trilijonas | ||
ones: trilijonai | ||
other: trilijonø | ||
quadrillions: | ||
one: kvadrilijonas | ||
ones: kvadrilijonai | ||
other: kvadrilijonø | ||
quintillions: | ||
one: kvintilijonas | ||
ones: kvadrilijonai | ||
other: kvadrilijonø | ||
sextillions: | ||
one: sekstilijonas | ||
ones: sekstilijonai | ||
other: sekstilijonø | ||
septillions: | ||
one: septilijonas | ||
ones: septilijonai | ||
other: septilijonø | ||
octillions: | ||
one: oktilijonas | ||
ones: oktilijonai | ||
other: oktilijonø | ||
nonillions: | ||
one: nonilijonas | ||
ones: nonilijonai | ||
other: nonilijonø | ||
decillions: | ||
one: decilijonas | ||
ones: decilijonai | ||
other: decilijonø |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module NumbersAndWords | ||
module I18n | ||
module Plurals | ||
module Lt | ||
RULE = lambda do |n| | ||
one_conditions(n) ? | ||
:one : ones_conditions(n) ? | ||
:ones : :other | ||
end | ||
|
||
extend self | ||
|
||
def one_conditions n | ||
n % 10 == 1 && n % 100 != 11 | ||
end | ||
|
||
def ones_conditions n | ||
[2, 3, 4, 5, 6, 7, 8, 9].include?(n % 10) && ![12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
lib/numbers_and_words/strategies/figures_converter/languages/et.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module NumbersAndWords | ||
module Strategies | ||
module FiguresConverter | ||
module Languages | ||
class Et < Base | ||
include Families::Latin | ||
|
||
def megs | ||
super({:number => @figures.number_in_capacity(@current_capacity)}) | ||
end | ||
|
||
end | ||
end | ||
end | ||
end | ||
end |
37 changes: 37 additions & 0 deletions
37
lib/numbers_and_words/strategies/figures_converter/languages/lt.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module NumbersAndWords | ||
module Strategies | ||
module FiguresConverter | ||
module Languages | ||
class Lt < Base | ||
include Families::Latin | ||
|
||
private | ||
|
||
def capacity_iteration | ||
words = [] | ||
capacity_words = words_in_capacity(@current_capacity) | ||
words.push(megs) unless capacity_words.empty? | ||
words += capacity_words unless is_a_thousand? and is_a_one? | ||
words | ||
end | ||
|
||
def is_a_one? | ||
[translations.ones(1)] == words_in_capacity(@current_capacity) | ||
end | ||
|
||
def is_a_thousand? | ||
FiguresArray::THOUSAND_CAPACITY == @current_capacity | ||
end | ||
|
||
def hundreds | ||
super({:is_hundred => (figures[1,2] == [0,1] && simple_number_to_words.empty?)}) | ||
end | ||
|
||
def megs | ||
super({:number => @figures.number_in_capacity(@current_capacity)}) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.