n2words 1.23.0 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +182 -53
  3. package/dist/languages/ar.js +2 -0
  4. package/dist/languages/ar.js.map +1 -0
  5. package/dist/languages/az.js +2 -0
  6. package/dist/languages/az.js.map +1 -0
  7. package/dist/languages/bn.js +2 -0
  8. package/dist/languages/bn.js.map +1 -0
  9. package/dist/languages/cs.js +2 -0
  10. package/dist/languages/cs.js.map +1 -0
  11. package/dist/languages/da.js +2 -0
  12. package/dist/languages/da.js.map +1 -0
  13. package/dist/languages/de.js +2 -0
  14. package/dist/languages/de.js.map +1 -0
  15. package/dist/languages/el.js +2 -0
  16. package/dist/languages/el.js.map +1 -0
  17. package/dist/languages/en.js +2 -0
  18. package/dist/languages/en.js.map +1 -0
  19. package/dist/languages/es.js +2 -0
  20. package/dist/languages/es.js.map +1 -0
  21. package/dist/languages/fa.js +2 -0
  22. package/dist/languages/fa.js.map +1 -0
  23. package/dist/languages/fil.js +2 -0
  24. package/dist/languages/fil.js.map +1 -0
  25. package/dist/languages/fr-BE.js +2 -0
  26. package/dist/languages/fr-BE.js.map +1 -0
  27. package/dist/languages/fr.js +2 -0
  28. package/dist/languages/fr.js.map +1 -0
  29. package/dist/languages/gu.js +2 -0
  30. package/dist/languages/gu.js.map +1 -0
  31. package/dist/languages/he.js +2 -0
  32. package/dist/languages/he.js.map +1 -0
  33. package/dist/languages/hi.js +2 -0
  34. package/dist/languages/hi.js.map +1 -0
  35. package/dist/languages/hr.js +2 -0
  36. package/dist/languages/hr.js.map +1 -0
  37. package/dist/languages/hu.js +2 -0
  38. package/dist/languages/hu.js.map +1 -0
  39. package/dist/languages/id.js +2 -0
  40. package/dist/languages/id.js.map +1 -0
  41. package/dist/languages/it.js +2 -0
  42. package/dist/languages/it.js.map +1 -0
  43. package/dist/languages/ja.js +2 -0
  44. package/dist/languages/ja.js.map +1 -0
  45. package/dist/languages/kn.js +2 -0
  46. package/dist/languages/kn.js.map +1 -0
  47. package/dist/languages/ko.js +2 -0
  48. package/dist/languages/ko.js.map +1 -0
  49. package/dist/languages/lt.js +2 -0
  50. package/dist/languages/lt.js.map +1 -0
  51. package/dist/languages/lv.js +2 -0
  52. package/dist/languages/lv.js.map +1 -0
  53. package/dist/languages/mr.js +2 -0
  54. package/dist/languages/mr.js.map +1 -0
  55. package/dist/languages/ms.js +2 -0
  56. package/dist/languages/ms.js.map +1 -0
  57. package/dist/languages/nb.js +2 -0
  58. package/dist/languages/nb.js.map +1 -0
  59. package/dist/languages/nl.js +2 -0
  60. package/dist/languages/nl.js.map +1 -0
  61. package/dist/languages/pa-Guru.js +2 -0
  62. package/dist/languages/pa-Guru.js.map +1 -0
  63. package/dist/languages/pl.js +2 -0
  64. package/dist/languages/pl.js.map +1 -0
  65. package/dist/languages/pt.js +2 -0
  66. package/dist/languages/pt.js.map +1 -0
  67. package/dist/languages/ro.js +2 -0
  68. package/dist/languages/ro.js.map +1 -0
  69. package/dist/languages/ru.js +2 -0
  70. package/dist/languages/ru.js.map +1 -0
  71. package/dist/languages/sr-Latn.js +2 -0
  72. package/dist/languages/sr-Latn.js.map +1 -0
  73. package/dist/languages/sv.js +2 -0
  74. package/dist/languages/sv.js.map +1 -0
  75. package/dist/languages/sw.js +2 -0
  76. package/dist/languages/sw.js.map +1 -0
  77. package/dist/languages/ta.js +2 -0
  78. package/dist/languages/ta.js.map +1 -0
  79. package/dist/languages/te.js +2 -0
  80. package/dist/languages/te.js.map +1 -0
  81. package/dist/languages/th.js +2 -0
  82. package/dist/languages/th.js.map +1 -0
  83. package/dist/languages/tr.js +2 -0
  84. package/dist/languages/tr.js.map +1 -0
  85. package/dist/languages/uk.js +2 -0
  86. package/dist/languages/uk.js.map +1 -0
  87. package/dist/languages/ur.js +2 -0
  88. package/dist/languages/ur.js.map +1 -0
  89. package/dist/languages/vi.js +2 -0
  90. package/dist/languages/vi.js.map +1 -0
  91. package/dist/languages/zh-Hans.js +2 -0
  92. package/dist/languages/zh-Hans.js.map +1 -0
  93. package/dist/n2words.js +1 -1
  94. package/dist/n2words.js.map +1 -1
  95. package/lib/classes/abstract-language.js +211 -110
  96. package/lib/classes/greedy-scale-language.js +195 -0
  97. package/lib/classes/slavic-language.js +251 -0
  98. package/lib/classes/south-asian-language.js +161 -0
  99. package/lib/classes/turkic-language.js +63 -0
  100. package/lib/languages/ar.js +243 -0
  101. package/lib/languages/az.js +58 -0
  102. package/lib/languages/bn.js +126 -0
  103. package/lib/languages/cs.js +212 -0
  104. package/lib/languages/da.js +167 -0
  105. package/lib/languages/de.js +135 -0
  106. package/lib/languages/el.js +116 -0
  107. package/lib/languages/en.js +123 -0
  108. package/lib/languages/es.js +153 -0
  109. package/lib/languages/fa.js +127 -0
  110. package/lib/languages/fil.js +162 -0
  111. package/lib/languages/fr-BE.js +61 -0
  112. package/lib/languages/fr.js +145 -0
  113. package/lib/languages/gu.js +156 -0
  114. package/lib/languages/he.js +329 -0
  115. package/lib/languages/hi.js +126 -0
  116. package/lib/languages/hr.js +157 -0
  117. package/lib/languages/hu.js +155 -0
  118. package/lib/languages/id.js +174 -0
  119. package/lib/languages/it.js +148 -0
  120. package/lib/languages/ja.js +190 -0
  121. package/lib/languages/kn.js +71 -0
  122. package/lib/languages/ko.js +83 -0
  123. package/lib/languages/lt.js +171 -0
  124. package/lib/languages/lv.js +153 -0
  125. package/lib/languages/mr.js +156 -0
  126. package/lib/languages/ms.js +146 -0
  127. package/lib/languages/nb.js +120 -0
  128. package/lib/languages/nl.js +206 -0
  129. package/lib/languages/pa-Guru.js +126 -0
  130. package/lib/languages/pl.js +189 -0
  131. package/lib/languages/pt.js +147 -0
  132. package/lib/languages/ro.js +380 -0
  133. package/lib/languages/ru.js +116 -0
  134. package/lib/languages/sr-Latn.js +157 -0
  135. package/lib/languages/sv.js +127 -0
  136. package/lib/languages/sw.js +121 -0
  137. package/lib/languages/ta.js +226 -0
  138. package/lib/languages/te.js +229 -0
  139. package/lib/languages/th.js +123 -0
  140. package/lib/languages/tr.js +83 -0
  141. package/lib/{i18n → languages}/uk.js +50 -23
  142. package/lib/languages/ur.js +126 -0
  143. package/lib/languages/vi.js +193 -0
  144. package/lib/languages/zh-Hans.js +165 -0
  145. package/lib/n2words.js +246 -75
  146. package/package.json +80 -72
  147. package/typings/classes/abstract-language.d.ts +144 -0
  148. package/typings/classes/greedy-scale-language.d.ts +148 -0
  149. package/typings/classes/slavic-language.d.ts +145 -0
  150. package/typings/classes/south-asian-language.d.ts +101 -0
  151. package/typings/classes/turkic-language.d.ts +42 -0
  152. package/typings/languages/ar.d.ts +93 -0
  153. package/typings/languages/az.d.ts +25 -0
  154. package/typings/languages/bn.d.ts +1 -0
  155. package/typings/languages/cs.d.ts +120 -0
  156. package/typings/languages/da.d.ts +53 -0
  157. package/typings/languages/de.d.ts +26 -0
  158. package/typings/languages/el.d.ts +11 -0
  159. package/typings/languages/en.d.ts +30 -0
  160. package/typings/languages/es.d.ts +43 -0
  161. package/typings/languages/fa.d.ts +81 -0
  162. package/typings/languages/fil.d.ts +12 -0
  163. package/typings/languages/fr-BE.d.ts +41 -0
  164. package/typings/languages/fr.d.ts +43 -0
  165. package/typings/languages/gu.d.ts +12 -0
  166. package/typings/languages/he.d.ts +197 -0
  167. package/typings/languages/hi.d.ts +1 -0
  168. package/typings/languages/hr.d.ts +110 -0
  169. package/typings/languages/hu.d.ts +37 -0
  170. package/typings/languages/id.d.ts +69 -0
  171. package/typings/languages/it.d.ts +51 -0
  172. package/typings/languages/ja.d.ts +58 -0
  173. package/typings/languages/kn.d.ts +11 -0
  174. package/typings/languages/ko.d.ts +25 -0
  175. package/typings/languages/lt.d.ts +110 -0
  176. package/typings/languages/lv.d.ts +99 -0
  177. package/typings/languages/mr.d.ts +12 -0
  178. package/typings/languages/ms.d.ts +37 -0
  179. package/typings/languages/nb.d.ts +27 -0
  180. package/typings/languages/nl.d.ts +65 -0
  181. package/typings/languages/pa-Guru.d.ts +1 -0
  182. package/typings/languages/pl.d.ts +116 -0
  183. package/typings/languages/pt.d.ts +39 -0
  184. package/typings/languages/ro.d.ts +229 -0
  185. package/typings/languages/ru.d.ts +108 -0
  186. package/typings/languages/sr-Latn.d.ts +98 -0
  187. package/typings/languages/sv.d.ts +30 -0
  188. package/typings/languages/sw.d.ts +1 -0
  189. package/typings/languages/ta.d.ts +1 -0
  190. package/typings/languages/te.d.ts +1 -0
  191. package/typings/languages/th.d.ts +1 -0
  192. package/typings/languages/tr.d.ts +46 -0
  193. package/typings/languages/uk.d.ts +117 -0
  194. package/typings/languages/ur.d.ts +1 -0
  195. package/typings/languages/vi.d.ts +116 -0
  196. package/typings/languages/zh-Hans.d.ts +57 -0
  197. package/typings/n2words.d.ts +177 -0
  198. package/dist/ar.js +0 -2
  199. package/dist/ar.js.map +0 -1
  200. package/dist/az.js +0 -2
  201. package/dist/az.js.map +0 -1
  202. package/dist/cz.js +0 -2
  203. package/dist/cz.js.map +0 -1
  204. package/dist/de.js +0 -2
  205. package/dist/de.js.map +0 -1
  206. package/dist/dk.js +0 -2
  207. package/dist/dk.js.map +0 -1
  208. package/dist/en.js +0 -2
  209. package/dist/en.js.map +0 -1
  210. package/dist/es.js +0 -2
  211. package/dist/es.js.map +0 -1
  212. package/dist/fa.js +0 -2
  213. package/dist/fa.js.map +0 -1
  214. package/dist/fr-BE.js +0 -2
  215. package/dist/fr-BE.js.map +0 -1
  216. package/dist/fr.js +0 -2
  217. package/dist/fr.js.map +0 -1
  218. package/dist/he.js +0 -2
  219. package/dist/he.js.map +0 -1
  220. package/dist/hr.js +0 -2
  221. package/dist/hr.js.map +0 -1
  222. package/dist/hu.js +0 -2
  223. package/dist/hu.js.map +0 -1
  224. package/dist/id.js +0 -2
  225. package/dist/id.js.map +0 -1
  226. package/dist/it.js +0 -2
  227. package/dist/it.js.map +0 -1
  228. package/dist/ko.js +0 -2
  229. package/dist/ko.js.map +0 -1
  230. package/dist/lt.js +0 -2
  231. package/dist/lt.js.map +0 -1
  232. package/dist/lv.js +0 -2
  233. package/dist/lv.js.map +0 -1
  234. package/dist/n2words.d.ts +0 -2
  235. package/dist/nl.js +0 -2
  236. package/dist/nl.js.map +0 -1
  237. package/dist/no.js +0 -2
  238. package/dist/no.js.map +0 -1
  239. package/dist/pl.js +0 -2
  240. package/dist/pl.js.map +0 -1
  241. package/dist/pt.js +0 -2
  242. package/dist/pt.js.map +0 -1
  243. package/dist/ro.js +0 -2
  244. package/dist/ro.js.map +0 -1
  245. package/dist/ru.js +0 -2
  246. package/dist/ru.js.map +0 -1
  247. package/dist/sr.js +0 -2
  248. package/dist/sr.js.map +0 -1
  249. package/dist/tr.js +0 -2
  250. package/dist/tr.js.map +0 -1
  251. package/dist/uk.js +0 -2
  252. package/dist/uk.js.map +0 -1
  253. package/dist/vi.js +0 -2
  254. package/dist/vi.js.map +0 -1
  255. package/dist/zh.js +0 -2
  256. package/dist/zh.js.map +0 -1
  257. package/lib/classes/abstract-language.d.ts +0 -54
  258. package/lib/classes/base-language.d.ts +0 -58
  259. package/lib/classes/base-language.js +0 -172
  260. package/lib/i18n/ar.d.ts +0 -41
  261. package/lib/i18n/ar.js +0 -209
  262. package/lib/i18n/az.d.ts +0 -15
  263. package/lib/i18n/az.js +0 -66
  264. package/lib/i18n/cz.d.ts +0 -68
  265. package/lib/i18n/cz.js +0 -135
  266. package/lib/i18n/de.d.ts +0 -17
  267. package/lib/i18n/de.js +0 -103
  268. package/lib/i18n/dk.d.ts +0 -14
  269. package/lib/i18n/dk.js +0 -110
  270. package/lib/i18n/en.d.ts +0 -22
  271. package/lib/i18n/en.js +0 -86
  272. package/lib/i18n/es.d.ts +0 -16
  273. package/lib/i18n/es.js +0 -110
  274. package/lib/i18n/fa.d.ts +0 -54
  275. package/lib/i18n/fa.js +0 -106
  276. package/lib/i18n/fr-BE.d.ts +0 -11
  277. package/lib/i18n/fr-BE.js +0 -20
  278. package/lib/i18n/fr.d.ts +0 -15
  279. package/lib/i18n/fr.js +0 -99
  280. package/lib/i18n/he.d.ts +0 -61
  281. package/lib/i18n/he.js +0 -132
  282. package/lib/i18n/hr.d.ts +0 -68
  283. package/lib/i18n/hr.js +0 -129
  284. package/lib/i18n/hu.d.ts +0 -17
  285. package/lib/i18n/hu.js +0 -135
  286. package/lib/i18n/id.d.ts +0 -43
  287. package/lib/i18n/id.js +0 -156
  288. package/lib/i18n/it.d.ts +0 -29
  289. package/lib/i18n/it.js +0 -137
  290. package/lib/i18n/ko.d.ts +0 -15
  291. package/lib/i18n/ko.js +0 -56
  292. package/lib/i18n/lt.d.ts +0 -68
  293. package/lib/i18n/lt.js +0 -138
  294. package/lib/i18n/lv.d.ts +0 -57
  295. package/lib/i18n/lv.js +0 -120
  296. package/lib/i18n/nl.d.ts +0 -20
  297. package/lib/i18n/nl.js +0 -125
  298. package/lib/i18n/no.d.ts +0 -15
  299. package/lib/i18n/no.js +0 -77
  300. package/lib/i18n/pl.d.ts +0 -67
  301. package/lib/i18n/pl.js +0 -126
  302. package/lib/i18n/pt.d.ts +0 -26
  303. package/lib/i18n/pt.js +0 -118
  304. package/lib/i18n/ro.d.ts +0 -109
  305. package/lib/i18n/ro.js +0 -360
  306. package/lib/i18n/ru.d.ts +0 -30
  307. package/lib/i18n/ru.js +0 -198
  308. package/lib/i18n/sr.d.ts +0 -56
  309. package/lib/i18n/sr.js +0 -127
  310. package/lib/i18n/tr.d.ts +0 -15
  311. package/lib/i18n/tr.js +0 -64
  312. package/lib/i18n/uk.d.ts +0 -78
  313. package/lib/i18n/vi.d.ts +0 -70
  314. package/lib/i18n/vi.js +0 -151
  315. package/lib/i18n/zh.d.ts +0 -18
  316. package/lib/i18n/zh.js +0 -78
  317. package/lib/n2words.d.ts +0 -9
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Converts a number to Lithuanian cardinal (written) form.
3
+ *
4
+ * @param {number|string|bigint} value The number to convert.
5
+ * @param {Object} [options={}] Configuration options.
6
+ * @param {boolean} [options.feminine=false] Use feminine forms for numbers.
7
+ * @returns {string} The number expressed in Lithuanian words.
8
+ * @throws {TypeError} If value is NaN or invalid type.
9
+ * @throws {Error} If value is an invalid number string.
10
+ */
11
+ export default function convertToWords(value: number | string | bigint, options?: {
12
+ feminine?: boolean;
13
+ }): string;
14
+ /**
15
+ * @typedef {Object} SlavicOptions
16
+ * @property {boolean} [feminine=false] Use feminine forms for numbers.
17
+ */
18
+ /**
19
+ * Lithuanian language converter.
20
+ *
21
+ * Implements Lithuanian number words using the Slavic language pattern:
22
+ * - Lithuanian number words (vienas/viena, du/dvi, trys, keturi...)
23
+ * - Gender-aware forms (masculine/feminine)
24
+ * - Baltic three-form pluralization (tūkstantis/tūkstančiai/tūkstančių)
25
+ * - Lithuanian-specific declension patterns
26
+ *
27
+ * Key Features:
28
+ * - Three-form pluralization system shared across Slavic/Baltic languages
29
+ * * Form 1 (singular): 1 (e.g., "tūkstantis")
30
+ * * Form 2 (few): 2-4, 22-24, 32-34... excluding teens (e.g., "tūkstančiai")
31
+ * * Form 3 (many): all other numbers (e.g., "tūkstančių")
32
+ * - Chunk-based decomposition (splits into groups of 3 digits: ones, thousands, millions, etc.)
33
+ * - Large number handling via thousands[] array with indexed [singular, few, many] forms
34
+ * - Gender-specific number forms for 1 and 2 (masculine/feminine dual forms)
35
+ *
36
+ * Features:
37
+ * - Dual gender forms (vienas/viena, du/dvi, keturi/keturios)
38
+ * - Complex declension patterns for large numbers
39
+ * - Baltic language characteristics
40
+ *
41
+ * Inherits from SlavicLanguage as Lithuanian uses similar pluralization.
42
+ */
43
+ export class Lithuanian extends SlavicLanguage {
44
+ ones: {
45
+ 1: string;
46
+ 2: string;
47
+ 3: string;
48
+ 4: string;
49
+ 5: string;
50
+ 6: string;
51
+ 7: string;
52
+ 8: string;
53
+ 9: string;
54
+ };
55
+ onesFeminine: {
56
+ 1: string;
57
+ 2: string;
58
+ 3: string;
59
+ 4: string;
60
+ 5: string;
61
+ 6: string;
62
+ 7: string;
63
+ 8: string;
64
+ 9: string;
65
+ };
66
+ tens: {
67
+ 0: string;
68
+ 1: string;
69
+ 2: string;
70
+ 3: string;
71
+ 4: string;
72
+ 5: string;
73
+ 6: string;
74
+ 7: string;
75
+ 8: string;
76
+ 9: string;
77
+ };
78
+ twenties: {
79
+ 2: string;
80
+ 3: string;
81
+ 4: string;
82
+ 5: string;
83
+ 6: string;
84
+ 7: string;
85
+ 8: string;
86
+ 9: string;
87
+ };
88
+ hundreds: string[];
89
+ thousands: {
90
+ 1: string[];
91
+ 2: string[];
92
+ 3: string[];
93
+ 4: string[];
94
+ 5: string[];
95
+ 6: string[];
96
+ 7: string[];
97
+ 8: string[];
98
+ 9: string[];
99
+ 10: string[];
100
+ };
101
+ pluralize(n: any, forms: any): any;
102
+ convertWholePart(number: any): string;
103
+ }
104
+ export type SlavicOptions = {
105
+ /**
106
+ * Use feminine forms for numbers.
107
+ */
108
+ feminine?: boolean;
109
+ };
110
+ import SlavicLanguage from '../classes/slavic-language.js';
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Converts a number to Latvian cardinal (written) form.
3
+ *
4
+ * @param {number|string|bigint} value The number to convert.
5
+ * @param {Object} [options={}] Configuration options.
6
+ * @param {boolean} [options.feminine=false] Use feminine forms for numbers.
7
+ * @returns {string} The number expressed in Latvian words.
8
+ * @throws {TypeError} If value is NaN or invalid type.
9
+ * @throws {Error} If value is an invalid number string.
10
+ */
11
+ export default function convertToWords(value: number | string | bigint, options?: {
12
+ feminine?: boolean;
13
+ }): string;
14
+ /**
15
+ * @typedef {Object} SlavicOptions
16
+ * @property {boolean} [feminine=false] Use feminine forms for numbers.
17
+ */
18
+ /**
19
+ * Latvian language converter.
20
+ *
21
+ * Implements Latvian number words using the Slavic language pattern:
22
+ * - Latvian number words (viens, divi, trīs, četri, pieci...)
23
+ * - Latvian-specific pluralization patterns
24
+ * - Baltic grammatical structure
25
+ * - Simplified gender handling compared to Lithuanian
26
+ *
27
+ * Key Features:
28
+ * - Three-form pluralization system shared across Slavic/Baltic languages
29
+ * * Form 1 (singular): 1 (e.g., "tūkstotis")
30
+ * * Form 2 (few): 2-4, 22-24, 32-34... excluding teens (e.g., "tūkstoši")
31
+ * * Form 3 (many): all other numbers (e.g., "tūkstošu")
32
+ * - Chunk-based decomposition (splits into groups of 3 digits: ones, thousands, millions, etc.)
33
+ * - Large number handling via thousands[] array with indexed [singular, few, many] forms
34
+ *
35
+ * Features:
36
+ * - Latvian diacritical marks (ī, ā, ē, ū, etc.)
37
+ * - Three-form pluralization (adapted for Latvian)
38
+ * - Baltic number naming conventions
39
+ * - Compound number formation (divdesmit, trīsdesmit)
40
+ *
41
+ * Inherits from SlavicLanguage for pluralization algorithms.
42
+ */
43
+ export class Latvian extends SlavicLanguage {
44
+ ones: {
45
+ 1: string;
46
+ 2: string;
47
+ 3: string;
48
+ 4: string;
49
+ 5: string;
50
+ 6: string;
51
+ 7: string;
52
+ 8: string;
53
+ 9: string;
54
+ };
55
+ tens: {
56
+ 0: string;
57
+ 1: string;
58
+ 2: string;
59
+ 3: string;
60
+ 4: string;
61
+ 5: string;
62
+ 6: string;
63
+ 7: string;
64
+ 8: string;
65
+ 9: string;
66
+ };
67
+ twenties: {
68
+ 2: string;
69
+ 3: string;
70
+ 4: string;
71
+ 5: string;
72
+ 6: string;
73
+ 7: string;
74
+ 8: string;
75
+ 9: string;
76
+ };
77
+ hundreds: string[];
78
+ thousands: {
79
+ 1: string[];
80
+ 2: string[];
81
+ 3: string[];
82
+ 4: string[];
83
+ 5: string[];
84
+ 6: string[];
85
+ 7: string[];
86
+ 8: string[];
87
+ 9: string[];
88
+ 10: string[];
89
+ };
90
+ pluralize(n: any, forms: any): any;
91
+ convertWholePart(number: any): string;
92
+ }
93
+ export type SlavicOptions = {
94
+ /**
95
+ * Use feminine forms for numbers.
96
+ */
97
+ feminine?: boolean;
98
+ };
99
+ import SlavicLanguage from '../classes/slavic-language.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Convert a number to Marathi words
3
+ *
4
+ * @param {number|string|bigint} value - The number to convert
5
+ * @param {Object} [options={}] - Conversion options
6
+ * @returns {string} The Marathi word representation
7
+ * @example
8
+ * convertToWords(42) // 'बेचाळीस'
9
+ * convertToWords(1000) // 'एक हजार'
10
+ * convertToWords(100000) // 'एक लाख'
11
+ */
12
+ export default function convertToWords(value: number | string | bigint, options?: any): string;
@@ -0,0 +1,37 @@
1
+ export default function convertToWords(value: any, options?: {}): string;
2
+ /**
3
+ * Malay (Bahasa Melayu) language converter.
4
+ *
5
+ * Conventions:
6
+ * - Base-10 structure
7
+ * - "Se-" prefix for singular units (seratus, seribu, sejuta, sebilion, setrilion)
8
+ * - Space-separated components (no conjunction like "dan" for tens/ones)
9
+ * - Grouping by thousands (ribu, juta, bilion, trilion)
10
+ */
11
+ export class Malay extends AbstractLanguage {
12
+ base: {
13
+ 0: any[];
14
+ 1: string[];
15
+ 2: string[];
16
+ 3: string[];
17
+ 4: string[];
18
+ 5: string[];
19
+ 6: string[];
20
+ 7: string[];
21
+ 8: string[];
22
+ 9: string[];
23
+ };
24
+ thousands: {
25
+ 3: string;
26
+ 6: string;
27
+ 9: string;
28
+ 12: string;
29
+ };
30
+ splitBy3(number: any): any[][];
31
+ spell(blocks: any): any[];
32
+ getHundreds(number: any): any[];
33
+ getTens(number: any): any;
34
+ join(wordBlocks: any): string;
35
+ convertWholePart(number: any): string;
36
+ }
37
+ import AbstractLanguage from '../classes/abstract-language.js';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Converts a number to Norwegian cardinal (written) form.
3
+ *
4
+ * @param {number|string|bigint} value The number to convert.
5
+ * @param {Object} [options] Conversion options (see Norwegian class options).
6
+ * @returns {string} The number expressed in Norwegian words.
7
+ * @throws {TypeError} If value is NaN or invalid type.
8
+ * @throws {Error} If value is an invalid number string.
9
+ *
10
+ * @example
11
+ * convertToWords(42); // 'førti-to'
12
+ * convertToWords('1.5'); // 'en komma fem'
13
+ */
14
+ export default function convertToWords(value: number | string | bigint, options?: any): string;
15
+ /**
16
+ * Norwegian language converter.
17
+ *
18
+ * GreedyScaleLanguage with inline Norwegian merge rules:
19
+ * - Hyphenation for compound numbers (e.g., "tjueen")
20
+ * - "og" (and) for hundreds combinations
21
+ * - Comma separation for non-magnitude additions
22
+ * - Implicit '1' before tens and magnitudes
23
+ * - Space separators for large numbers
24
+ */
25
+ export class Norwegian extends GreedyScaleLanguage {
26
+ }
27
+ import GreedyScaleLanguage from '../classes/greedy-scale-language.js';
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Converts a number to Dutch cardinal (written) form.
3
+ *
4
+ * @param {number|string|bigint} value The number to convert.
5
+ * @param {Object} [options] Conversion options (see Dutch class options).
6
+ * @param {boolean} [options.includeOptionalAnd=false] Include optional 'en' (and) separator.
7
+ * @param {boolean} [options.noHundredPairs=false] Don't combine hundreds with tens/units.
8
+ * @param {boolean} [options.accentOne=true] Use accented 'één' for standalone 1.
9
+ * @returns {string} The number expressed in Dutch words.
10
+ * @throws {TypeError} If value is NaN or invalid type.
11
+ * @throws {Error} If value is an invalid number string.
12
+ *
13
+ * @example
14
+ * convertToWords(1); // 'één' (default accent)
15
+ * convertToWords(1, { accentOne: false }); // 'een'
16
+ * convertToWords(21); // 'eenentwintig' (no accent in compounds)
17
+ * convertToWords(42); // 'tweeenveertig'
18
+ * convertToWords('1.5'); // 'één komma vijf'
19
+ */
20
+ export default function convertToWords(value: number | string | bigint, options?: {
21
+ includeOptionalAnd?: boolean;
22
+ noHundredPairs?: boolean;
23
+ accentOne?: boolean;
24
+ }): string;
25
+ /**
26
+ * @typedef {Object} DutchOptions
27
+ * @property {boolean} [includeOptionalAnd=false] Include optional "en" separator.
28
+ * @property {boolean} [noHundredPairs=false] Disable comma before hundreds.
29
+ * @property {boolean} [accentOne=true] Use accented "één" for one.
30
+ */
31
+ /**
32
+ * Dutch language converter.
33
+ *
34
+ * Features:
35
+ * - Optional "en" (and) separator for tens (includeOptionalAnd)
36
+ * - Optional comma before hundreds (noHundredPairs)
37
+ * - Compound word formation without hyphenation
38
+ */
39
+ export class Dutch extends GreedyScaleLanguage {
40
+ /**
41
+ * Initializes the Dutch converter with language-specific options.
42
+ *
43
+ * @param {DutchOptions} [options={}] Configuration options.
44
+ */
45
+ constructor({ includeOptionalAnd, noHundredPairs, accentOne }?: DutchOptions);
46
+ includeOptionalAnd: boolean;
47
+ noHundredPairs: boolean;
48
+ accentOne: boolean;
49
+ convertWholePart(value: any): string;
50
+ }
51
+ export type DutchOptions = {
52
+ /**
53
+ * Include optional "en" separator.
54
+ */
55
+ includeOptionalAnd?: boolean;
56
+ /**
57
+ * Disable comma before hundreds.
58
+ */
59
+ noHundredPairs?: boolean;
60
+ /**
61
+ * Use accented "één" for one.
62
+ */
63
+ accentOne?: boolean;
64
+ };
65
+ import GreedyScaleLanguage from '../classes/greedy-scale-language.js';
@@ -0,0 +1 @@
1
+ export default function convertToWords(value: any, options?: {}): string;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Converts a number to Polish cardinal (written) form.
3
+ *
4
+ * @param {number|string|bigint} value The number to convert.
5
+ * @param {SlavicOptions} [options={}] Configuration options.
6
+ * @returns {string} The number expressed in Polish words.
7
+ * @throws {TypeError} If value is NaN or invalid type.
8
+ * @throws {Error} If value is an invalid number string.
9
+ */
10
+ export default function convertToWords(value: number | string | bigint, options?: SlavicOptions): string;
11
+ /**
12
+ * @typedef {Object} SlavicOptions
13
+ * @property {boolean} [feminine=false] Use feminine forms for numbers.
14
+ */
15
+ /**
16
+ * Polish language converter.
17
+ *
18
+ * Implements Polish number words using the Slavic language pattern:
19
+ * - Polish number words (jeden, dwa, trzy, cztery, pięć...)
20
+ * - Complex Slavic three-form pluralization (tysiąc/tysiące/tysięcy)
21
+ * - Polish-specific declension patterns
22
+ * - Distinctive Polish phonology and orthography
23
+ *
24
+ * Key Features:
25
+ * - Three-form pluralization system shared across Slavic languages
26
+ * * Form 1 (singular): 1 (e.g., "tysiąc")
27
+ * * Form 2 (few): 2-4, 22-24, 32-34... excluding teens (e.g., "tysiące")
28
+ * * Form 3 (many): all other numbers (e.g., "tysięcy")
29
+ * - Chunk-based decomposition (splits into groups of 3 digits: ones, thousands, millions, etc.)
30
+ * - Large number handling via thousands[] array with indexed [singular, few, many] forms
31
+ *
32
+ * Features:
33
+ * - Polish diacritical marks (ą, ć, ę, ł, ń, ś, ź, ż)
34
+ * - Gender and case agreement
35
+ * - Polish-specific number word endings
36
+ *
37
+ * Inherits from SlavicLanguage for complex pluralization algorithms.
38
+ */
39
+ export class Polish extends SlavicLanguage {
40
+ ones: {
41
+ 1: string;
42
+ 2: string;
43
+ 3: string;
44
+ 4: string;
45
+ 5: string;
46
+ 6: string;
47
+ 7: string;
48
+ 8: string;
49
+ 9: string;
50
+ };
51
+ tens: {
52
+ 0: string;
53
+ 1: string;
54
+ 2: string;
55
+ 3: string;
56
+ 4: string;
57
+ 5: string;
58
+ 6: string;
59
+ 7: string;
60
+ 8: string;
61
+ 9: string;
62
+ };
63
+ twenties: {
64
+ 2: string;
65
+ 3: string;
66
+ 4: string;
67
+ 5: string;
68
+ 6: string;
69
+ 7: string;
70
+ 8: string;
71
+ 9: string;
72
+ };
73
+ hundreds: {
74
+ 1: string;
75
+ 2: string;
76
+ 3: string;
77
+ 4: string;
78
+ 5: string;
79
+ 6: string;
80
+ 7: string;
81
+ 8: string;
82
+ 9: string;
83
+ };
84
+ thousands: {
85
+ 1: string[];
86
+ 2: string[];
87
+ 3: string[];
88
+ 4: string[];
89
+ 5: string[];
90
+ 6: string[];
91
+ 7: string[];
92
+ 8: string[];
93
+ 9: string[];
94
+ 10: string[];
95
+ };
96
+ /**
97
+ * Implements Polish-specific three-form pluralization rules.
98
+ *
99
+ * Polish three-form system:
100
+ * - Form 1 (singular): exactly n=1 (e.g., "tysiąc")
101
+ * - Form 2 (few): n ends in 2-4, excluding teens (22-24, 32-34...) (e.g., "tysiące")
102
+ * - Form 3 (many): all other numbers (e.g., "tysięcy")
103
+ *
104
+ * @param {bigint} n The number to classify.
105
+ * @param {Array<string>} forms Array of [singular, few, many] word forms.
106
+ * @returns {string} The appropriate form for the number n.
107
+ */
108
+ pluralize(n: bigint, forms: Array<string>): string;
109
+ }
110
+ export type SlavicOptions = {
111
+ /**
112
+ * Use feminine forms for numbers.
113
+ */
114
+ feminine?: boolean;
115
+ };
116
+ import SlavicLanguage from '../classes/slavic-language.js';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Converts a number to Portuguese cardinal (written) form.
3
+ *
4
+ * @param {number|string|bigint} value The number to convert.
5
+ * @param {Object} [options] Conversion options (see Portuguese class options).
6
+ * @returns {string} The number expressed in Portuguese words.
7
+ * @throws {TypeError} If value is NaN or invalid type.
8
+ * @throws {Error} If value is an invalid number string.
9
+ *
10
+ * @example
11
+ * convertToWords(42); // 'quarenta e dois'
12
+ * convertToWords('100.5'); // 'cem vírgula cinco'
13
+ */
14
+ export default function convertToWords(value: number | string | bigint, options?: any): string;
15
+ /**
16
+ * (European) Portuguese language converter.
17
+ *
18
+ * Features:
19
+ * - Gender-aware hundreds (hundredos, duzentos, etc.)
20
+ * - Million/Billion pluralization
21
+ * - "e" (and) conjunction for number combinations
22
+ * - Post-processing to normalize word flow
23
+ */
24
+ export class Portuguese extends GreedyScaleLanguage {
25
+ static POSTCLEAN_REGEX: RegExp;
26
+ hundreds: {
27
+ 1: string;
28
+ 2: string;
29
+ 3: string;
30
+ 4: string;
31
+ 5: string;
32
+ 6: string;
33
+ 7: string;
34
+ 8: string;
35
+ 9: string;
36
+ };
37
+ finalizeWords(words: any): any;
38
+ }
39
+ import GreedyScaleLanguage from '../classes/greedy-scale-language.js';