sv.sor 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. ^0 noll
  2. ^1$ ett
  3. ^1 en
  4. 1 ett
  5. 2 två
  6. 3 tre
  7. 4 fyra
  8. 5 fem
  9. 6 sex
  10. 7 sju
  11. 8 åtta
  12. 9 nio
  13. 10 tio
  14. 11 elva
  15. 12 tolv
  16. 13 tretton
  17. 14 fjorton
  18. 15 femton
  19. 16 sexton
  20. 17 sjutton
  21. 18 arton
  22. 19 nitton
  23. 2(\d) tjugo$1
  24. 3(\d) trettio$1
  25. 4(\d) fyrtio$1
  26. 7(\d) sjuttio$1
  27. 8(\d) åttio$1
  28. 9(\d) nittio$1
  29. (\d)(\d) $1tio$2
  30. (\d)(\d\d) $1|hundra$2
  31. # “ettusen” instead of “etttusen”
  32. (1|\d?[02-9]1)(\d{3}) $1|usen[ $2]
  33. (\d{1,3})(\d{3}) $1tusen[ $2]
  34. (\d{1,3})(\d{6}) |$1 miljon$(pl:\1)[ $2]
  35. (\d{1,3})(\d{9}) |$1 miljard$(pl:\1)[ $2]
  36. (\d{1,3})(\d{12}) |$1 biljon$(pl:\1)[ $2]
  37. (\d{1,3})(\d{15}) |$1 biljard$(pl:\1)[ $2]
  38. (\d{1,3})(\d{18}) |$1 triljon$(pl:\1)[ $2]
  39. (\d{1,3})(\d{21}) |$1 triljard$(pl:\1)[ $2]
  40. (\d{1,3})(\d{24}) |$1 kvadriljon$(pl:\1)[ $2]
  41. # plural for big numbers
  42. pl:1
  43. pl:.* er
  44. # negative number
  45. [-−](\d+) minus |$1
  46. # decimals
  47. "([-−]?\d+)[.,]" $1| komma
  48. "([-−]?\d+[.,])([^0]\d)" $1| |$2
  49. "([-−]?\d+[.,])(\d)(\d)(\d)" $1| |$2 |$3 |$4
  50. "([-−]?\d+[.,]\d*)(\d)" $1| |$2
  51. # currency
  52. # unit/subunit singular/plural
  53. "us, (.*): (.*), (.*), (.*), (.*), (.*), (.*)" $(\2 \1) \3
  54. "up, (.*): (.*), (.*), (.*), (.*), (.*), (.*)" $(\2 \1) \4
  55. "ss, (.*): (.*), (.*), (.*), (.*), (.*), (.*)" $(\5 \1) \6
  56. "sp, (.*): (.*), (.*), (.*), (.*), (.*), (.*)" $(\5 \1) \7
  57. CHF:(\D+,.*) $(\1: cardinal, schweizisk franc, schweizisk franc, cardinal, centime, centime)
  58. CNY:(\D+,.*) $(\1: cardinal, yuan renminbi, yuan renminbi, cardinal, fen, fen)
  59. EUR:(\D+,.*) $(\1: cardinal, euro, euro, cardinal-neuter, cent, cent)
  60. GBP:(\D+,.*) $(\1: cardinal-neuter, brittiskt pund, brittiskt pund, cardinal, penny, pence)
  61. JPY:(\D+,.*) $(\1: cardinal, yen, yen, cardinal, sen, sen)
  62. SEK:(\D+,.*) $(\1: cardinal, svensk krona, svenska kronor, cardinal-neuter, öre, öre)
  63. USD:(\D+,.*) $(\1: cardinal, US-dollar, US-dollar, cardinal-neuter, cent, cent)
  64. "([A-Z]{3}) ([-−]?1)([.,]00?)?"$(\1:us, \2)
  65. "([A-Z]{3}) ([-−]?\d+)([.,]00?)?"$(\1:up, \2)
  66. "(CNY [-−]?\d+)[.,]10?" $1 $2 jiao
  67. "(CNY [-−]?\d+)[.,](\d)0?" $1 $2 jiao
  68. "(CNY [-−]?\d+[.,]\d)1" $1 $2 fen
  69. "(CNY [-−]?\d+[.,]\d)(\d)" $1 $2 fen
  70. "(([A-Z]{3}) [-−]?\d+)[.,](01)" $1 $(\2:ss, 1)
  71. "(([A-Z]{3}) [-−]?\d+)[.,](\d)" $1 $(\2:sp, \30)
  72. "(([A-Z]{3}) [-−]?\d+)[.,](\d\d)" $1 $(\2:sp, \3)
  73. == cardinal-neuter ==
  74. 1 ett
  75. == cardinal(-feminine|-masculine|-neuter)? ==
  76. ([-−]?\d+) $(cardinal |$2)
  77. "(.*[^ ]e)t(tusen.*)" $(cardinal \2n\3) # 21000, 31000 .. 991000
  78. "(.*e)tt([ ].*|$)" $(cardinal \2n\3) # !etthundra, !ettusen
  79. (.*) \2
  80. == ordinal(-masculine)? ==
  81. ([-−]?\d+) $(ordinal |$2)
  82. == ordinal ==
  83. (.*)ett \1förste # 1
  84. (.*)två \1andre # 2
  85. (.*)tre \1tredje # 3
  86. (.*)fyra \1fjärde # 4
  87. (.*)sex \1sjätte # 6
  88. (.*(sju|io)) \1nde # 7, 9, 10, 20..90
  89. (.*)åtta \1åttonde # 8
  90. (.*)elva \1elfte # 11
  91. (.*)tolv \1tolfte # 12
  92. "(.*(ton|hundra|tusen)) *" \1de # 13, 14..19, 100, 1000
  93. "(.*)er *" \1te # milljoner...
  94. "(.*[^ ]) *" \1te # 0, 5, milljon...
  95. == ordinal-feminine ==
  96. ([-−]?\d+) $(ordinal-feminine $(ordinal |$1))
  97. (.*(först|andr))e \1a # 1, 2
  98. (.*) \1
  99. == ordinal-neuter ==
  100. (.*) $(ordinal-feminine |$1)
  101. == ordinal-number(-feminine|-neuter)? ==
  102. (.*[02-9][12]|[12]) \2:a
  103. == ordinal-number(-feminine|-neuter|-masculine)? ==
  104. (.*) \2:e
  105. == year ==
  106. ([-−]?(1[1-9]|[2-9]\d))(\d\d) $1hundra$3
  107. (.*) $1
  108. == help ==
  109. "" $(1)|, $(2), $(3)\n$(\0 cardinal-feminine)$(\0 cardinal-masculine)$(\0 cardinal-neuter)$(\0 ordinal-feminine)$(\0 ordinal-masculine)$(\0 ordinal-neuter)$(\0 ordinal-number)$(\0 ordinal-number-feminine)$(\0 ordinal-number-masculine)
  110. ((ordinal|cardinal)(-number)?(-feminine|-masculine|-neuter)?) \1: $(\1 1), $(\1 2), $(\1 3)\n