hr.sor 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. #
  2. # Regular number to text transducer for Serbian (Cyrillic) written in Soros
  3. # Copyright (c) Goran Rakic <grakic@devbase.net> 2009.
  4. # Modified and translated for Croatian by Mihovil Stanic <mihovil.stanic@gmail.com> 2014.
  5. #
  6. # Released under Creative Commons 3.0 Attribution - Share Alike license
  7. # and relicensed under GNU Lesser General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # Visit http://numbertext.org for more info on Soros language and syntax
  12. #
  13. (\d{1,3})\.([\d.,]+) $(\1\2)
  14. ^0 nula
  15. 1 jedan
  16. 2 dva
  17. 3 tri
  18. 4 četiri
  19. 5 pet
  20. 6 šest
  21. 7 sedam
  22. 8 osam
  23. 9 devet
  24. 10 deset
  25. 11 jedanaest
  26. 14 četrnaest
  27. 16 šesnaest
  28. 1(\d) $1naest
  29. 4(\d) četrdeset[ $1]
  30. 5(\d) pedeset[ $1]
  31. 6(\d) šezdeset[ $1]
  32. 9(\d) devedeset[ $1]
  33. (\d)(\d) $1deset[ $2]
  34. 1(\d\d) sto[ $1]
  35. 2(\d\d) dvjesto[ $1]
  36. 3(\d\d) tristo[ $1]
  37. (\d)(\d\d) $1sto[ $2]
  38. 1(\d\d\d) tisuću[ $1]
  39. 2(\d\d\d) dvije tisuće[ $1]
  40. ([34])(\d\d\d) $1 tisuće[ $2]
  41. (\d{0,1})1(\d)(\d\d\d) $(\11\2) tisuća[ $3]
  42. (\d{1,2})1(\d\d\d) $(\10) jedna tisuća[ $2]
  43. (\d{1,2})2(\d\d\d) $(\10) dvije tisuće[ $2]
  44. (\d{1,2})([34])(\d\d\d) $(\10) $2 tisuće[ $3]
  45. (\d{1,3})(\d\d\d) $1 tisuća[ $2]
  46. 1(\d{6}) milion[ $1]
  47. (\d{0,4})1(\d)(\d{6}) $(\11\2) miliona[ $3]
  48. (\d{1,5})1(\d{6}) $(\10) jedan milion[ $2]
  49. (\d{1,3})(\d{6}) $1 miliona[ $2]
  50. 1(\d{9}) milijarda[ $1]
  51. 2(\d{9}) dvije milijarde[ $1]
  52. ([34])(\d{9}) $1 milijarde[ $2]
  53. (\d{1,2})0(\d{9}) $(\10) milijardi[ $2]
  54. (\d{0,1})1(\d)(\d{9}) $(\11\2) milijardi[ $3]
  55. (\d{1,2})1(\d{9}) $(\10) jedna milijarda[ $2]
  56. (\d{1,2})2(\d{9}) $(\10) dvije milijarde[ $2]
  57. (\d{1,2})([34])(\d{9}) $(\10) $2 milijarde[ $3]
  58. (\d{1,3})(\d{9}) $1 milijarde[ $2]
  59. 1(\d{12}) bilijun[ $1]
  60. (\d{0,4})1(\d)(\d{12}) $(\11\2) bilijuna[ $3]
  61. (\d{1,5})1(\d{12}) $(\10) jedan bilijun[ $2]
  62. (\d{1,6})(\d{12}) $1 bilijuna[ $2]
  63. 1(\d{18}) trilijun[ $1]
  64. (\d{0,4})1(\d)(\d{18}) $(\11\2) trilijuna[ $3]
  65. (\d{1,5})1(\d{18}) $(\10) jedan trilijun[ $2]
  66. (\d{1,6})(\d{18}) $1 trilijuna[ $2]
  67. 1(\d{24}) kvadrilijun[ $1]
  68. (\d{0,4})1(\d)(\d{24}) $(\11\2) kvadrilijuna[ $3]
  69. (\d{1,5})1(\d{24}) $(\10) jedan kvadrilijun[ $2]
  70. (\d{1,6})(\d{24}) $1 kvadrilijuna[ $2]
  71. 1(\d{30}) kvintilijun[ $1]
  72. (\d{0,4})1(\d)(\d{30}) $(\11\2) kvintilijuna[ $3]
  73. (\d{1,5})1(\d{30}) $(\10) jedan kvintilijun[ $2]
  74. (\d{1,6})(\d{30}) $1 kvintilijuna[ $2]
  75. 1(\d{36}) sekstilijun[ $1]
  76. (\d{0,4})1(\d)(\d{36}) $(\11\2) sekstilijuna[ $3]
  77. (\d{1,5})1(\d{36}) $(\10) jedan sekstilijun[ $2]
  78. (\d{1,6})(\d{36}) $1 sekstilijuna[ $2]
  79. # negative number
  80. [-−] minus
  81. [-−](\d+) minus |$1
  82. # Decimal code by https://twitter.com/_uranium_
  83. "([-−]?\d+)[.,]" $1| zarez
  84. "([-−]?\d+[.,])([^0]\d)" $1 $2
  85. "([-−]?\d+[.,]\d*[1-9]?)0+$" $1
  86. "([-−]?\d+[.,])(\d)(\d)(\d)" $1| |$2 |$3 |$4
  87. "([-−]?\d+[.,]\d*)(\d)" $1 |$2
  88. # currency
  89. # unit/subunit
  90. us:([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*) \1
  91. up:([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*) \2
  92. ug:([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*) \3
  93. ss:([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*) \4
  94. sp:([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*) \5
  95. sg:([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*) \6
  96. HRK:(\D+) $(\1: kuna, kune, kuna, lipa, lipe, lipa) #ff
  97. DKK:(\D+) $(\1: kruna, krune, kruna, ora, ore, ora) #ff
  98. SEK:(\D+) $(\1: kruna, krune, kruna, ora, ore, ora) #ff
  99. CZK:(\D+) $(\1: kruna, krune, kruna, haler, halera, halera) #fm
  100. HUF:(\D+) $(\1: forinta, forinte, forinti, filer, filera, filera) #fm
  101. GBP:(\D+) $(\1: funta, funte, funti, peni, penija, penija) #fm
  102. BAM:(\D+) $(\1: konvertibilna marka, konvertibilne marke, konvertibilnih marki, fening, feninga, feninga) #fm
  103. BGN:(\D+) $(\1: lev, leva, leva, stotinka, stotinke, stotinki) #mf
  104. RSD:(\D+) $(\1: dinar, dinara, dinara, para, pare, para) #mf
  105. RON:(\D+) $(\1: leu, leu, leu, ban, bana, bana) #mm
  106. CHF:(\D+) $(\1: franak, franka, franaka, centim, centima, centima) #mm
  107. EUR:(\D+) $(\1: euro, eura, eura, cent, centa, centa) #mm
  108. USD:(\D+) $(\1: dolar, dolara, dolara, cent, centa, centa) #mm
  109. PLN:(\D+) $(\1: zlot, zlota, zlota, groš, groša, groša) #mm
  110. # Covers cases where currency sign is after numbers or different position
  111. "(.*) kn" $(HRK \1)
  112. "(.*) €" $(EUR \1)
  113. "(.*)€" $(EUR \1)
  114. "€(.*)" $(EUR \1)
  115. "€ (.*)" $(EUR \1)
  116. "(.*) Ft" $(HUF \1)
  117. "(.*) din." $(RSD \1)
  118. "\$(.*)" $(USD \1)
  119. "\$ (.*)" $(USD \1)
  120. "(.*) \$" $(USD \1)
  121. "KM(.*)" $(BAM \1)
  122. "£(.*)" $(GBP \1)
  123. "(.*) HRK" $(HRK \1)
  124. "(.*) DKK" $(DKK \1)
  125. "(.*) SEK" $(SEK \1)
  126. "(.*) CZK" $(CZK \1)
  127. "(.*) HUF" $(HUF \1)
  128. "(.*) GBP" $(GBP \1)
  129. "(.*) BAM" $(BAM \1)
  130. "(.*) BGN" $(BGN \1)
  131. "(.*) RSD" $(RSD \1)
  132. "(.*) RON" $(RON \1)
  133. "(.*) CHF" $(CHF \1)
  134. "(.*) EUR" $(EUR \1)
  135. "(.*) USD" $(USD \1)
  136. "(.*) PLN" $(PLN \1)
  137. "(HRK|DKK|SEK|CZK|HUF|GBP|BAM) ([-−]?1)([.,]00?)?" jedna$(\1:us) #female, for 1
  138. "(HRK|DKK|SEK|CZK|HUF|GBP|BAM) ([-−]?2)([.,]00?)?" dvije$(\1:up) #female, for 2
  139. "(HRK|DKK|SEK|CZK|HUF|GBP|BAM) ([02-9])1([.,]00?)?" $(\20) jedna$(\1:us) #female, for numbers from 21-91 ending with 1
  140. "(HRK|DKK|SEK|CZK|HUF|GBP|BAM) ([02-9])2([.,]00?)?" $(\20) dvije$(\1:up) #female, for numbers from 22-92 ending with 2
  141. "(HRK|DKK|SEK|CZK|HUF|GBP|BAM) ([-−]?\d*)([02-9])1([.,]00?)?" $(\200) $(\30) jedna$(\1:us) #female, for numbers >100 ending with 1 but not 11
  142. "(HRK|DKK|SEK|CZK|HUF|GBP|BAM) ([-−]?\d*)([02-9])2([.,]00?)?" $(\200) $(\30) dvije$(\1:up) #female, for numbers >100 ending with 2 but not 12
  143. "([A-Z]{3}) ([-−]?1)([.,]00?)?" $2|$(\1:us)
  144. "([A-Z]{3}) ([-−]?\d*[02-9]1)([.,]00?)?" $2|$(\1:us)
  145. "([A-Z]{3}) ([-−]?[234])([.,]00?)?" $2|$(\1:up)
  146. "([A-Z]{3}) ([-−]?\d*[02-9][234])([.,]00?)?" $2|$(\1:up)
  147. "([A-Z]{3}) ([-−]?\d+)([.,]00?)?" $2|$(\1:ug)
  148. "((HRK|DKK|SEK|BGN|RSD) [-−]?\d+)[.,]([02-9])1" $1 $(\30) jedna $(\2:ss) #decimal, female, ending with 1 but not 11
  149. "((HRK|DKK|SEK|BGN|RSD) [-−]?\d+)[.,]([02-9])2" $1 $(\30) dvije $(\2:sp) #decimal, female, ending with 2 but not 12
  150. "(([A-Z]{3}) [-−]?\d+)[.,](01)" $1 |$(1)$(\2:ss)
  151. "(([A-Z]{3}) [-−]?\d+)[.,]([02-9]1)" $1 |$3$(\2:ss)
  152. "(([A-Z]{3}) [-−]?\d+)[.,]([02-9][234])" $1 |$3$(\2:sp)
  153. "(([A-Z]{3}) [-−]?\d+)[.,](\d)" $1 |$(\30)$(\2:sg)
  154. "(([A-Z]{3}) [-−]?\d+)[.,](\d\d)" $1 |$3$(\2:sg)
  155. == ordinal-number ==
  156. (\d+) \1.
  157. == help ==
  158. "" |$(1)|, |$(2)|, |$(3)|\n$(help ordinal-number)
  159. (.*) \1: |$(\1 1)|, |$(\1 2)|, |$(\1 3)|\n