en.sor 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. ^0 zero
  2. 1 one
  3. 2 two
  4. 3 three
  5. 4 four
  6. 5 five
  7. 6 six
  8. 7 seven
  9. 8 eight
  10. 9 nine
  11. 10 ten
  12. 11 eleven
  13. 12 twelve
  14. 13 thirteen
  15. 15 fifteen
  16. 18 eighteen
  17. 1(\d) $1teen
  18. 2(\d) twenty[-$1]
  19. 3(\d) thirty[-$1]
  20. 4(\d) forty[-$1]
  21. 5(\d) fifty[-$1]
  22. 8(\d) eighty[-$1]
  23. (\d)(\d) $1ty[-$2]
  24. # separator function
  25. :0+ # one million
  26. :0*\d?\d " and " # one million and twenty-two
  27. :\d+ ", " # one million, one thousand
  28. (\d)(\d\d) $1 hundred[ and $2] # one hundred and one [:en-AU:] [:en-GB:] [:en-IE:] [:en-NZ:]
  29. (\d)(\d\d) $1 hundred[ $2] # default: one hundred one
  30. (\d{1,2})([1-9]\d\d) $1 thousand[ $2] # ten thousand two hundred
  31. (\d{1,2})(\d{3}) $1 thousand$(:\2)$2 # [:en-IN:] one hundred thousand, two hundred
  32. (\d{1,2})(000\d\d) $1 lakh$(:\2)$2 # [:en-IN:] one lakh and two
  33. (\d{1,2})(\d{5}) $1 lakh[ $2] # [:en-IN:] one lakh two hundred
  34. (\d{1,4})(\d{7}) $1 crore$(:\2)$2 # [:en-IN:]
  35. (\d{1,3})(\d{3}) $1 thousand$(:\2)$2 # one hundred thousand, two hundred
  36. (\d{1,3})(\d{6}) $1 million$(:\2)$2
  37. (\d{1,3})(\d{9}) $1 billion$(:\2)$2
  38. (\d{1,3})(\d{12}) $1 trillion$(:\2)$2
  39. (\d{1,3})(\d{15}) $1 quadrillion$(:\2)$2
  40. (\d{1,3})(\d{18}) $1 quintillion$(:\2)$2
  41. (\d{1,3})(\d{21}) $1 sextillion$(:\2)$2
  42. (\d{1,3})(\d{24}) $1 septillion$(:\2)$2
  43. (\d{1,3})(\d{27}) $1 octillion$(:\2)$2
  44. (\d{1,3})(\d{30}) $1 nonillion$(:\2)$2
  45. (\d{1,3})(\d{33}) $1 decillion$(:\2)$2
  46. (\d{1,3})(\d{36}) $1 undecillion$(:\2)$2
  47. (\d{1,3})(\d{39}) $1 duodecillion$(:\2)$2
  48. (\d{1,3})(\d{42}) $1 tredecillion$(:\2)$2
  49. # negative number
  50. [-−](\d+) negative |$1
  51. # decimals
  52. 0[.,] point
  53. ([-−]?\d+)[.,] $1| point
  54. ([-−]?\d+[.,]\d*)(\d) $1| |$2
  55. # currency
  56. # unit/subunit singular/plural
  57. us:([^,]*),([^,]*),([^,]*),([^,]*) \1
  58. up:([^,]*),([^,]*),([^,]*),([^,]*) \2
  59. ss:([^,]*),([^,]*),([^,]*),([^,]*) \3
  60. sp:([^,]*),([^,]*),([^,]*),([^,]*) \4
  61. AUD:(\D+) $(\1: Australian dollar, Australian dollars, cent, cents)
  62. BGN:(\D+) $(\1: lev, leva, stotinka, stotinki)
  63. BWP:(\D+) $(\1: pula, pula, thebe, thebe)
  64. CAD:(\D+) $(\1: Canadian dollar, Canadian dollars, cent, cents)
  65. CHF:(\D+) $(\1: Swiss franc, Swiss francs, centime, centimes)
  66. CNY:(\D+) $(\1: Chinese yuan, Chinese yuan, fen, fen)
  67. CZK:(\D+) $(\1: Czech koruna, Czech koruny, halér, halére)
  68. EEK:(\D+) $(\1: kroon, kroonid, sent, senti)
  69. EUR:(\D+) $(\1: euro, euro, cent, cents)
  70. GBP:(\D+) $(\1: pound sterling, pounds sterling, penny, pence)
  71. GHS:(\D+) $(\1: Ghana cedi, Ghana cedis, pesewa, pesewas)
  72. GMD:(\D+) $(\1: dalasi, dalasi, butut, bututs)
  73. HKD:(\D+) $(\1: Hong Kong dollar, Hong Kong dollars, cent, cents)
  74. HRK:(\D+) $(\1: kuna, kuna, lipa, lipa)
  75. HUF:(\D+) $(\1: forint, forint, fillér, fillér)
  76. INR:(\D+) $(\1: Indian rupee, Indian rupees, paisa, paise)
  77. JMD:(\D+) $(\1: Jamaica dollar, Jamaica dollars, cent, cents)
  78. JPY:(\D+) $(\1: Japanese yen, Japanese yen, sen, sen)
  79. KES:(\D+) $(\1: Kenyan shilling, Kenyan shillings, cent, cents)
  80. KRW:(\D+) $(\1: Korean won, Korean won, jeon, jeon)
  81. LRD:(\D+) $(\1: Liberian dollar, Liberian dollars, cent, cents)
  82. LSL:(\D+) $(\1: loti, maloti, sente, lisente)
  83. LTL:(\D+) $(\1: litas, litai, centas, centai)
  84. LVL:(\D+) $(\1: lats, lati, santims, santimi)
  85. MGA:(\D+) $(\1: ariary, ariaries, iraimbilanja, iraimbilanja)
  86. MUR:(\D+) $(\1: Mauritian rupee, Mauritian rupees, cent, cents)
  87. MXN:(\D+) $(\1: Mexican peso, Mexican pesos, centavo, centavos)
  88. MWK:(\D+) $(\1: Malawian kwacha, Malawian kwacha, tambala, tambala)
  89. MYR:(\D+) $(\1: Ringgit, Ringgit, cent, cents)
  90. NAD:(\D+) $(\1: Namibian dollar, Namibian dollars, cent, cents)
  91. NGN:(\D+) $(\1: naira, naira, kobo, kobo)
  92. NZD:(\D+) $(\1: New Zealand dollar, New Zealand dollars, cent, cents)
  93. PGK:(\D+) $(\1: kina, kina, toea, toea)
  94. PHP:(\D+) $(\1: Philippine peso, Philippine pesos, centavo, centavos)
  95. PKR:(\D+) $(\1: Pakistani rupee, Pakistani rupees, paisa, paise)
  96. PLN:(\D+) $(\1: zloty, zlotys, grosz, groszy)
  97. RON:(\D+) $(\1: Romanian leu, Romanian lei, ban, bani)
  98. RSD:(\D+) $(\1: Serbian dinar, Serbian dinars, para, para)
  99. RUB:(\D+) $(\1: Russian ruble, Russian rubles, kopek, kopeks)
  100. RWF:(\D+) $(\1: Rwandese franc, Rwandese francs, centime, centimes)
  101. SDG:(\D+) $(\1: Sudanese pound, Sudanese pounds, piastre, piastres)
  102. SGD:(\D+) $(\1: Singapore dollar, Singapore dollars, cent, cents)
  103. SLL:(\D+) $(\1: leone, leones, cent, cents)
  104. SZL:(\D+) $(\1: lilangeni, emalangeni, cent, cents)
  105. THB:(\D+) $(\1: baht, baht, satang, satang)
  106. TRY:(\D+) $(\1: Turkish lira, Turkish lira, kurus, kurus)
  107. TTD:(\D+) $(\1: Trinidad and Tobago dollar, Trinidad and Tobago dollars, cent, cents)
  108. TZS:(\D+) $(\1: Tanzanian shilling, Tanzanian shillings, cent, cents)
  109. UAH:(\D+) $(\1: hryvnia, hryvnia, kopiyka, kopiyka)
  110. UGX:(\D+) $(\1: Uganda shilling, Uganda shillings, cent, cents)
  111. USD:(\D+) $(\1: U.S. dollar, U.S. dollars, cent, cents)
  112. X[AO]F:(\D+) $(\1: CFA franc, CFA francs, centime, centimes)
  113. ZAR:(\D+) $(\1: South African rand, South African rand, cent, cents)
  114. ZMK:(\D+) $(\1: Zambian kwacha, Zambian kwacha, ngwee, ngwee)
  115. ZWL:(\D+) $(\1: Zimbabwe dollar, Zimbabwe dollars, cent, cents)
  116. "(JPY [-−]?\d+)[.,](\d\d)0" $1
  117. "(JPY [-−]?\d+[.,]\d\d)(\d)" $1 $2 rin
  118. "([A-Z]{3}) ([-−]?1)([.,]00?)?" $2$(\1:us)
  119. "([A-Z]{3}) ([-−]?\d+)([.,]00?)?" $2$(\1:up)
  120. "(CNY [-−]?\d+)[.,](\d)0?" $1 $2 jiao
  121. "(CNY [-−]?\d+[.,]\d)(\d)" $1 $2 fen
  122. "((MGA|MRO) [-−]?\d+)[.,]0" $1
  123. "((MGA|MRO) [-−]?\d+)[.,]2" $1 and |$(1)$(\2:ss)
  124. "((MGA|MRO) [-−]?\d+)[.,]4" $1 and |$(2)$(\2:sp)
  125. "((MGA|MRO) [-−]?\d+)[.,]6" $1 and |$(3)$(\2:sp)
  126. "((MGA|MRO) [-−]?\d+)[.,]8" $1 and |$(4)$(\2:sp)
  127. "(([A-Z]{3}) [-−]?\d+)[.,](01)" $1 and |$(1)$(\2:ss)
  128. "(([A-Z]{3}) [-−]?\d+)[.,](\d)" $1 and |$(\30)$(\2:sp)
  129. "(([A-Z]{3}) [-−]?\d+)[.,](\d\d)" $1 and |$3$(\2:sp)
  130. == money ==
  131. "(JPY [-−]?\d+)[.,](\d\d)0" $1
  132. "(JPY [-−]?\d+[.,]\d\d)(\d)" $1 $2 rin
  133. "([A-Z]{3}) ([-−]?1)([.,]00?)?" $2$(\1:us)
  134. "([A-Z]{3}) ([-−]?\d+)([.,]00?)?" $2$(\1:up)
  135. "(CNY [-−]?\d+)[.,](\d)0?" $1 $2 jiao
  136. "(CNY [-−]?\d+[.,]\d)(\d)" $1 $2 fen
  137. "(MGA|MRO) ([-−]?\d+)[.,]0" $2$(\1:us)
  138. "(MGA|MRO) ([-−]?\d+)[.,]2" $2 and 1/5$(\1:us)
  139. "(MGA|MRO) ([-−]?\d+)[.,]4" $2 and 2/5$(\1:up)
  140. "(MGA|MRO) ([-−]?\d+)[.,]6" $2 and 3/5$(\1:up)
  141. "(MGA|MRO) ([-−]?\d+)[.,]8" $2 and 4/5$(\1:up)
  142. "([A-Z]{3}) ([-−]?1)" $2$(\1:us)
  143. "([A-Z]{3}) ([-−]?\d+)" $2$(\1:up)
  144. "(([A-Z]{3}) ([-−]?\d+))[.,](01)" $3 and 1/100$(\2:us)
  145. "(([A-Z]{3}) ([-−]?\d+))[.,](\d)" $3 and \40/100$(\2:up)
  146. "(([A-Z]{3}) ([-−]?\d+))[.,](\d\d)" $3 and \4/100$(\2:up)
  147. "(([A-Z]{3}) ([-−]?\d+))[.,](\d\d\d)" $3 and \4/1000$(\2:up)
  148. == ordinal ==
  149. # convert to text, and recall to convert
  150. # cardinal names to ordinal ones
  151. ([-−]?\d+) $(ordinal |$1)
  152. (.*)one \1first
  153. (.*)two \1second
  154. (.*)three \1third
  155. (.*)five \1fifth
  156. (.*)eight \1eighth
  157. (.*)nine \1ninth
  158. (.*)twelve \1twelfth
  159. (.*)y \1ieth
  160. (.*) \1th
  161. == ordinal-number ==
  162. (.*1\d) \1th
  163. (.*1) \1st
  164. (.*2) \1nd
  165. (.*3) \1rd
  166. (.*) \1th
  167. == year ==
  168. (1[1-9])00 $1 hundred
  169. (1[1-9])([0-9][0-9]) $1 $2
  170. (.*) $(year-remove-and $1)
  171. == year-remove-and ==
  172. "(.*) and (.*)" \1 \2
  173. (.*) \1
  174. == help ==
  175. "" $(1)|, $(2), $(3)\n$(\0 ordinal)$(\0 ordinal-number)year: $(year 1999), two thousand, $(year 2001)\ncurrency \(for example, USD\): $(USD 2.5)\nmoney USD: $(money USD 2.5)
  176. "(ordinal(-number)?|USD)" \1: $(\1 1), $(\1 2), $(\1 3)\n