5
from report_aeroo.ctt_objects import ctt_language
7
class en_US(ctt_language):
11
# digits - masculine, singular
12
self.digits_sng_msc = [u'zero', u'one', u'two', u'three', u'four',
13
u'five', u'six', u'seven', u'eight', u'nine']
14
# tens - masculine, singular
15
self.tens_sng_msc = [u'', u'one', u'twen', u'thir', u'four', u'fif',
16
u'six', u'seven', u'eigh', u'nine']
18
self.teens = [u'ten', u'eleven', u'twelve', u'thirteen', u'fourteen',
19
u'fifteen', u'sixteen', u'seventeen', u'eighteen',
21
# multiplier - masculine, singular
22
self.multi_sng_msc = [u' hundred', u' thousand', u' million',
24
# multiplier - masculine, plural
25
self.multi_plr_msc = [u' hundreds', u' thousands', u' millions',
28
# next line is needed for correct loading of currencies
33
def wordify(self, chunk, chunknr, gender):
35
number = self.digits_sng_msc
37
number = self.digits_sng_fem
39
number = self.digits_sng_neu
44
chunklength = len(chunk)
45
# placing digits in right places
56
if chunklength == 1 and digit3 == '0' :
61
words += self.digits_sng_msc[int(digit1)] + self.multi_sng_msc[0]
63
if int(digit1) >= 1 : words += self.digits_sng_msc[int(digit1)] + self.multi_plr_msc[0]
67
if len(words) > 0 : spacer = u' '
69
words += spacer + self.teens[int(digit3)]
71
if int(digit2) > 1 and int(digit2) > 0:
72
words += spacer + self.tens_sng_msc[int(digit2)] + u'ty'
75
if chunklength > 0 and digit2 != '1' :
77
if len(words) > 0: spacer = u' '
79
words += spacer + number[int(digit3)]
82
if digit3 == '1' and chunknr > 0:
83
return words + self.multi_sng_msc[chunknr]
84
elif digit3 != '1' and chunknr > 0:
85
return words + self.multi_sng_msc[chunknr]