@lunarisapp/hyphen 0.0.1

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 (112) hide show
  1. package/.turbo/turbo-build.log +23 -0
  2. package/.turbo/turbo-lint.log +12 -0
  3. package/.turbo/turbo-test.log +372 -0
  4. package/CHANGELOG.md +7 -0
  5. package/README.md +43 -0
  6. package/babel.config.js +6 -0
  7. package/dist/dictionaries/hyph_af_ZA.dic +5332 -0
  8. package/dist/dictionaries/hyph_as_IN.dic +100 -0
  9. package/dist/dictionaries/hyph_be_BY.dic +3385 -0
  10. package/dist/dictionaries/hyph_bg_BG.dic +6625 -0
  11. package/dist/dictionaries/hyph_ca.dic +3234 -0
  12. package/dist/dictionaries/hyph_cs_CZ.dic +3637 -0
  13. package/dist/dictionaries/hyph_da_DK.dic +1146 -0
  14. package/dist/dictionaries/hyph_de_AT.dic +77902 -0
  15. package/dist/dictionaries/hyph_de_CH.dic +77902 -0
  16. package/dist/dictionaries/hyph_de_DE.dic +77902 -0
  17. package/dist/dictionaries/hyph_el_GR.dic +579 -0
  18. package/dist/dictionaries/hyph_en_GB.dic +14062 -0
  19. package/dist/dictionaries/hyph_en_US.dic +11130 -0
  20. package/dist/dictionaries/hyph_eo.dic +3407 -0
  21. package/dist/dictionaries/hyph_es.dic +862 -0
  22. package/dist/dictionaries/hyph_et_EE.dic +3692 -0
  23. package/dist/dictionaries/hyph_fr.dic +2914 -0
  24. package/dist/dictionaries/hyph_gl.dic +290 -0
  25. package/dist/dictionaries/hyph_hr_HR.dic +1597 -0
  26. package/dist/dictionaries/hyph_hu_HU.dic +102260 -0
  27. package/dist/dictionaries/hyph_id_ID.dic +12033 -0
  28. package/dist/dictionaries/hyph_is.dic +7695 -0
  29. package/dist/dictionaries/hyph_it_IT.dic +421 -0
  30. package/dist/dictionaries/hyph_kn_IN.dic +100 -0
  31. package/dist/dictionaries/hyph_lt.dic +1547 -0
  32. package/dist/dictionaries/hyph_lv_LV.dic +11900 -0
  33. package/dist/dictionaries/hyph_mn_MN.dic +1004 -0
  34. package/dist/dictionaries/hyph_mr_IN.dic +199 -0
  35. package/dist/dictionaries/hyph_nb_NO.dic +27142 -0
  36. package/dist/dictionaries/hyph_nl_NL.dic +16257 -0
  37. package/dist/dictionaries/hyph_nn_NO.dic +27142 -0
  38. package/dist/dictionaries/hyph_pa_IN.dic +87 -0
  39. package/dist/dictionaries/hyph_pl_PL.dic +4824 -0
  40. package/dist/dictionaries/hyph_pt_BR.dic +1247 -0
  41. package/dist/dictionaries/hyph_pt_PT.dic +308 -0
  42. package/dist/dictionaries/hyph_ro_RO.dic +5220 -0
  43. package/dist/dictionaries/hyph_ru_RU.dic +3875 -0
  44. package/dist/dictionaries/hyph_sa_IN.dic +116 -0
  45. package/dist/dictionaries/hyph_sk_SK.dic +2468 -0
  46. package/dist/dictionaries/hyph_sl_SI.dic +1413 -0
  47. package/dist/dictionaries/hyph_sq_AL.dic +14020 -0
  48. package/dist/dictionaries/hyph_sr-Latn.dic +3412 -0
  49. package/dist/dictionaries/hyph_sr.dic +3365 -0
  50. package/dist/dictionaries/hyph_sv.dic +14954 -0
  51. package/dist/dictionaries/hyph_te_IN.dic +99 -0
  52. package/dist/dictionaries/hyph_th_TH.dic +5245 -0
  53. package/dist/dictionaries/hyph_uk_UA.dic +1654 -0
  54. package/dist/dictionaries/hyph_zu_ZA.dic +171 -0
  55. package/dist/index.d.mts +48 -0
  56. package/dist/index.d.ts +48 -0
  57. package/dist/index.js +236 -0
  58. package/dist/index.mjs +201 -0
  59. package/eslint.config.js +4 -0
  60. package/package.json +51 -0
  61. package/src/dictionaries/hyph_af_ZA.dic +5332 -0
  62. package/src/dictionaries/hyph_as_IN.dic +100 -0
  63. package/src/dictionaries/hyph_be_BY.dic +3385 -0
  64. package/src/dictionaries/hyph_bg_BG.dic +6625 -0
  65. package/src/dictionaries/hyph_ca.dic +3234 -0
  66. package/src/dictionaries/hyph_cs_CZ.dic +3637 -0
  67. package/src/dictionaries/hyph_da_DK.dic +1146 -0
  68. package/src/dictionaries/hyph_de_AT.dic +77902 -0
  69. package/src/dictionaries/hyph_de_CH.dic +77902 -0
  70. package/src/dictionaries/hyph_de_DE.dic +77902 -0
  71. package/src/dictionaries/hyph_el_GR.dic +579 -0
  72. package/src/dictionaries/hyph_en_GB.dic +14062 -0
  73. package/src/dictionaries/hyph_en_US.dic +11130 -0
  74. package/src/dictionaries/hyph_eo.dic +3407 -0
  75. package/src/dictionaries/hyph_es.dic +862 -0
  76. package/src/dictionaries/hyph_et_EE.dic +3692 -0
  77. package/src/dictionaries/hyph_fr.dic +2914 -0
  78. package/src/dictionaries/hyph_gl.dic +290 -0
  79. package/src/dictionaries/hyph_hr_HR.dic +1597 -0
  80. package/src/dictionaries/hyph_hu_HU.dic +102260 -0
  81. package/src/dictionaries/hyph_id_ID.dic +12033 -0
  82. package/src/dictionaries/hyph_is.dic +7695 -0
  83. package/src/dictionaries/hyph_it_IT.dic +421 -0
  84. package/src/dictionaries/hyph_kn_IN.dic +100 -0
  85. package/src/dictionaries/hyph_lt.dic +1547 -0
  86. package/src/dictionaries/hyph_lv_LV.dic +11900 -0
  87. package/src/dictionaries/hyph_mn_MN.dic +1004 -0
  88. package/src/dictionaries/hyph_mr_IN.dic +199 -0
  89. package/src/dictionaries/hyph_nb_NO.dic +27142 -0
  90. package/src/dictionaries/hyph_nl_NL.dic +16257 -0
  91. package/src/dictionaries/hyph_nn_NO.dic +27142 -0
  92. package/src/dictionaries/hyph_pa_IN.dic +87 -0
  93. package/src/dictionaries/hyph_pl_PL.dic +4824 -0
  94. package/src/dictionaries/hyph_pt_BR.dic +1247 -0
  95. package/src/dictionaries/hyph_pt_PT.dic +308 -0
  96. package/src/dictionaries/hyph_ro_RO.dic +5220 -0
  97. package/src/dictionaries/hyph_ru_RU.dic +3875 -0
  98. package/src/dictionaries/hyph_sa_IN.dic +116 -0
  99. package/src/dictionaries/hyph_sk_SK.dic +2468 -0
  100. package/src/dictionaries/hyph_sl_SI.dic +1413 -0
  101. package/src/dictionaries/hyph_sq_AL.dic +14020 -0
  102. package/src/dictionaries/hyph_sr-Latn.dic +3412 -0
  103. package/src/dictionaries/hyph_sr.dic +3365 -0
  104. package/src/dictionaries/hyph_sv.dic +14954 -0
  105. package/src/dictionaries/hyph_te_IN.dic +99 -0
  106. package/src/dictionaries/hyph_th_TH.dic +5245 -0
  107. package/src/dictionaries/hyph_uk_UA.dic +1654 -0
  108. package/src/dictionaries/hyph_zu_ZA.dic +171 -0
  109. package/src/dictionaries/update.sh +7 -0
  110. package/src/index.ts +235 -0
  111. package/tests/hyphen.test.ts +118 -0
  112. package/tsconfig.pkg.json +10 -0
@@ -0,0 +1,23 @@
1
+
2
+ 
3
+ > @lunarisapp/hyphen@0.0.1 build /Users/rsirokov/Projects/Lunaris/text-tools/packages/hyphen
4
+ > tsup src/index.ts --format cjs,esm --dts && copyfiles -u 1 src/dictionaries/*.dic dist
5
+
6
+ CLI Building entry: src/index.ts
7
+ CLI Using tsconfig: ../../tsconfig.json
8
+ CLI tsup v8.3.6
9
+ CLI Target: esnext
10
+ CJS Build start
11
+ ESM Build start
12
+ CJS You have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin
13
+ ESM You have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin
14
+ ESM dist/index.mjs 5.59 KB
15
+ ESM ⚡️ Build success in 44ms
16
+ CJS dist/index.js 7.26 KB
17
+ CJS ⚡️ Build success in 44ms
18
+ DTS Build start
19
+ error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["src/**/*.ts"]' and 'exclude' paths were '["node_modules","dist"]'.
20
+
21
+ DTS ⚡️ Build success in 816ms
22
+ DTS dist/index.d.ts 1.27 KB
23
+ DTS dist/index.d.mts 1.27 KB
@@ -0,0 +1,12 @@
1
+
2
+ 
3
+ > @lunaris/hyphen@0.0.1 lint /Users/rsirokov/Projects/Lunaris/text-tools/packages/hyphen
4
+ > eslint "{src,tests}/**/*.ts" --fix
5
+
6
+ (node:65030) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///Users/rsirokov/Projects/Lunaris/text-tools/packages/hyphen/eslint.config.js?mtime=1739479673334 is not specified and it doesn't parse as CommonJS.
7
+ Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
8
+ To eliminate this warning, add "type": "module" to /Users/rsirokov/Projects/Lunaris/text-tools/packages/hyphen/package.json.
9
+ (Use `node --trace-warnings ...` to show where the warning was created)
10
+ (node:65030) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///Users/rsirokov/Projects/Lunaris/text-tools/eslint.config.js is not specified and it doesn't parse as CommonJS.
11
+ Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
12
+ To eliminate this warning, add "type": "module" to /Users/rsirokov/Projects/Lunaris/text-tools/package.json.
@@ -0,0 +1,372 @@
1
+
2
+ 
3
+ > @lunaris/hyphen@0.0.1 test /Users/rsirokov/Projects/Lunaris/text-tools/packages/hyphen
4
+ > jest
5
+
6
+ Determining test suites to run...
7
+
8
+  RUNS  tests/hyphen.test.ts
9
+
10
+  RUNS  tests/hyphen.test.ts
11
+
12
+  RUNS  tests/hyphen.test.ts
13
+
14
+  RUNS  tests/hyphen.test.ts
15
+
16
+ TextHyphen {
17
+ left: 2,
18
+ right: 2,
19
+ dictionaries: {
20
+ af_ZA: 'hyph_af_ZA.dic',
21
+ af: 'hyph_af_ZA.dic',
22
+ as_IN: 'hyph_as_IN.dic',
23
+ as: 'hyph_as_IN.dic',
24
+ be_BY: 'hyph_be_BY.dic',
25
+ be: 'hyph_be_BY.dic',
26
+ bg_BG: 'hyph_bg_BG.dic',
27
+ bg: 'hyph_bg_BG.dic',
28
+ ca: 'hyph_ca.dic',
29
+ cs_CZ: 'hyph_cs_CZ.dic',
30
+ cs: 'hyph_cs_CZ.dic',
31
+ da_DK: 'hyph_da_DK.dic',
32
+ da: 'hyph_da_DK.dic',
33
+ de_AT: 'hyph_de_AT.dic',
34
+ de: 'hyph_de_AT.dic',
35
+ de_CH: 'hyph_de_CH.dic',
36
+ de_DE: 'hyph_de_DE.dic',
37
+ el_GR: 'hyph_el_GR.dic',
38
+ el: 'hyph_el_GR.dic',
39
+ en_GB: 'hyph_en_GB.dic',
40
+ en: 'hyph_en_GB.dic',
41
+ en_US: 'hyph_en_US.dic',
42
+ eo: 'hyph_eo.dic',
43
+ es: 'hyph_es.dic',
44
+ et_EE: 'hyph_et_EE.dic',
45
+ et: 'hyph_et_EE.dic',
46
+ fr: 'hyph_fr.dic',
47
+ gl: 'hyph_gl.dic',
48
+ hr_HR: 'hyph_hr_HR.dic',
49
+ hr: 'hyph_hr_HR.dic',
50
+ hu_HU: 'hyph_hu_HU.dic',
51
+ hu: 'hyph_hu_HU.dic',
52
+ id_ID: 'hyph_id_ID.dic',
53
+ id: 'hyph_id_ID.dic',
54
+ is: 'hyph_is.dic',
55
+ it_IT: 'hyph_it_IT.dic',
56
+ it: 'hyph_it_IT.dic',
57
+ kn_IN: 'hyph_kn_IN.dic',
58
+ kn: 'hyph_kn_IN.dic',
59
+ lt: 'hyph_lt.dic',
60
+ lv_LV: 'hyph_lv_LV.dic',
61
+ lv: 'hyph_lv_LV.dic',
62
+ mn_MN: 'hyph_mn_MN.dic',
63
+ mn: 'hyph_mn_MN.dic',
64
+ mr_IN: 'hyph_mr_IN.dic',
65
+ mr: 'hyph_mr_IN.dic',
66
+ nb_NO: 'hyph_nb_NO.dic',
67
+ nb: 'hyph_nb_NO.dic',
68
+ nl_NL: 'hyph_nl_NL.dic',
69
+ nl: 'hyph_nl_NL.dic',
70
+ nn_NO: 'hyph_nn_NO.dic',
71
+ nn: 'hyph_nn_NO.dic',
72
+ pa_IN: 'hyph_pa_IN.dic',
73
+ pa: 'hyph_pa_IN.dic',
74
+ pl_PL: 'hyph_pl_PL.dic',
75
+ pl: 'hyph_pl_PL.dic',
76
+ pt_BR: 'hyph_pt_BR.dic',
77
+ pt: 'hyph_pt_BR.dic',
78
+ pt_PT: 'hyph_pt_PT.dic',
79
+ ro_RO: 'hyph_ro_RO.dic',
80
+ ro: 'hyph_ro_RO.dic',
81
+ ru_RU: 'hyph_ru_RU.dic',
82
+ ru: 'hyph_ru_RU.dic',
83
+ sa_IN: 'hyph_sa_IN.dic',
84
+ sa: 'hyph_sa_IN.dic',
85
+ sk_SK: 'hyph_sk_SK.dic',
86
+ sk: 'hyph_sk_SK.dic',
87
+ sl_SI: 'hyph_sl_SI.dic',
88
+ sl: 'hyph_sl_SI.dic',
89
+ sq_AL: 'hyph_sq_AL.dic',
90
+ sq: 'hyph_sq_AL.dic',
91
+ sr_Latn: 'hyph_sr-Latn.dic',
92
+ sr: 'hyph_sr.dic',
93
+ sv: 'hyph_sv.dic',
94
+ te_IN: 'hyph_te_IN.dic',
95
+ te: 'hyph_te_IN.dic',
96
+ th_TH: 'hyph_th_TH.dic',
97
+ th: 'hyph_th_TH.dic',
98
+ uk_UA: 'hyph_uk_UA.dic',
99
+ uk: 'hyph_uk_UA.dic',
100
+ zu_ZA: 'hyph_zu_ZA.dic',
101
+ zu: 'hyph_zu_ZA.dic'
102
+ },
103
+ lowercaseLangs: {
104
+ af_za: 'af_ZA',
105
+ af: 'af',
106
+ as_in: 'as_IN',
107
+ as: 'as',
108
+ be_by: 'be_BY',
109
+ be: 'be',
110
+ bg_bg: 'bg_BG',
111
+ bg: 'bg',
112
+ ca: 'ca',
113
+ cs_cz: 'cs_CZ',
114
+ cs: 'cs',
115
+ da_dk: 'da_DK',
116
+ da: 'da',
117
+ de_at: 'de_AT',
118
+ de: 'de',
119
+ de_ch: 'de_CH',
120
+ de_de: 'de_DE',
121
+ el_gr: 'el_GR',
122
+ el: 'el',
123
+ en_gb: 'en_GB',
124
+ en: 'en',
125
+ en_us: 'en_US',
126
+ eo: 'eo',
127
+ es: 'es',
128
+ et_ee: 'et_EE',
129
+ et: 'et',
130
+ fr: 'fr',
131
+ gl: 'gl',
132
+ hr_hr: 'hr_HR',
133
+ hr: 'hr',
134
+ hu_hu: 'hu_HU',
135
+ hu: 'hu',
136
+ id_id: 'id_ID',
137
+ id: 'id',
138
+ is: 'is',
139
+ it_it: 'it_IT',
140
+ it: 'it',
141
+ kn_in: 'kn_IN',
142
+ kn: 'kn',
143
+ lt: 'lt',
144
+ lv_lv: 'lv_LV',
145
+ lv: 'lv',
146
+ mn_mn: 'mn_MN',
147
+ mn: 'mn',
148
+ mr_in: 'mr_IN',
149
+ mr: 'mr',
150
+ nb_no: 'nb_NO',
151
+ nb: 'nb',
152
+ nl_nl: 'nl_NL',
153
+ nl: 'nl',
154
+ nn_no: 'nn_NO',
155
+ nn: 'nn',
156
+ pa_in: 'pa_IN',
157
+ pa: 'pa',
158
+ pl_pl: 'pl_PL',
159
+ pl: 'pl',
160
+ pt_br: 'pt_BR',
161
+ pt: 'pt',
162
+ pt_pt: 'pt_PT',
163
+ ro_ro: 'ro_RO',
164
+ ro: 'ro',
165
+ ru_ru: 'ru_RU',
166
+ ru: 'ru',
167
+ sa_in: 'sa_IN',
168
+ sa: 'sa',
169
+ sk_sk: 'sk_SK',
170
+ sk: 'sk',
171
+ sl_si: 'sl_SI',
172
+ sl: 'sl',
173
+ sq_al: 'sq_AL',
174
+ sq: 'sq',
175
+ sr_latn: 'sr_Latn',
176
+ sr: 'sr',
177
+ sv: 'sv',
178
+ te_in: 'te_IN',
179
+ te: 'te',
180
+ th_th: 'th_TH',
181
+ th: 'th',
182
+ uk_ua: 'uk_UA',
183
+ uk: 'uk',
184
+ zu_za: 'zu_ZA',
185
+ zu: 'zu'
186
+ },
187
+ hd: HyphenDict {
188
+ patterns: Map(16199) {
189
+ 'ISO-' => [Array],
190
+ '.a' => [Array],
191
+ '.aan' => [Array],
192
+ '.aa' => [Array],
193
+ '.aarts' => [Array],
194
+ '.aart' => [Array],
195
+ '.aat' => [Array],
196
+ '.abl' => [Array],
197
+ '.ab' => [Array],
198
+ '.achtend' => [Array],
199
+ '.acht' => [Array],
200
+ '.achten' => [Array],
201
+ '.achte' => [Array],
202
+ '.acre' => [Array],
203
+ '.acr' => [Array],
204
+ '.adi' => [Array],
205
+ '.af' => [Array],
206
+ '.afl' => [Array],
207
+ '.afs' => [Array],
208
+ '.afture' => [Array],
209
+ '.aft' => [Array],
210
+ '.aftu' => [Array],
211
+ '.aftur' => [Array],
212
+ '.alee' => [Array],
213
+ '.ale' => [Array],
214
+ '.alf' => [Array],
215
+ '.alk' => [Array],
216
+ '.alko' => [Array],
217
+ '.alkov' => [Array],
218
+ '.alma' => [Array],
219
+ '.alm' => [Array],
220
+ '.alom' => [Array],
221
+ '.alo' => [Array],
222
+ '.alst' => [Array],
223
+ '.als' => [Array],
224
+ '.anas' => [Array],
225
+ '.ana' => [Array],
226
+ '.and' => [Array],
227
+ '.anen' => [Array],
228
+ '.ane' => [Array],
229
+ '.angl' => [Array],
230
+ '.ang' => [Array],
231
+ '.anth' => [Array],
232
+ '.ant' => [Array],
233
+ '.ard' => [Array],
234
+ '.artr' => [Array],
235
+ '.art' => [Array],
236
+ '.ash' => [Array],
237
+ '.asl' => [Array],
238
+ '.ast' => [Array],
239
+ '.astra' => [Array],
240
+ '.astr' => [Array],
241
+ '.asu' => [Array],
242
+ '.ata' => [Array],
243
+ '.at' => [Array],
244
+ '.aven' => [Array],
245
+ '.av' => [Array],
246
+ '.ave' => [Array],
247
+ '.b' => [Array],
248
+ '.bela' => [Array],
249
+ '.be' => [Array],
250
+ '.bera' => [Array],
251
+ '.beri' => [Array],
252
+ '.bos' => [Array],
253
+ '.bo' => [Array],
254
+ '.c' => [Array],
255
+ '.coo' => [Array],
256
+ '.co' => [Array],
257
+ '.coro' => [Array],
258
+ '.cus' => [Array],
259
+ '.cu' => [Array],
260
+ '.d' => [Array],
261
+ '.daar' => [Array],
262
+ '.da' => [Array],
263
+ '.daa' => [Array],
264
+ '.dagi' => [Array],
265
+ '.dag' => [Array],
266
+ '.dagr' => [Array],
267
+ '.dak' => [Array],
268
+ '.dan' => [Array],
269
+ '.debe' => [Array],
270
+ '.de' => [Array],
271
+ '.deb' => [Array],
272
+ '.dek' => [Array],
273
+ '.dekl' => [Array],
274
+ '.deks' => [Array],
275
+ '.denkr' => [Array],
276
+ '.denk' => [Array],
277
+ '.deod' => [Array],
278
+ '.deo' => [Array],
279
+ '.dero' => [Array],
280
+ '.desta' => [Array],
281
+ '.des' => [Array],
282
+ '.dest' => [Array],
283
+ '.dia' => [Array],
284
+ '.di' => [Array],
285
+ '.diep' => [Array],
286
+ '.die' => [Array],
287
+ '.dio' => [Array],
288
+ '.doet' => [Array],
289
+ ... 16099 more items
290
+ },
291
+ cache: Map(0) {},
292
+ maxLen: 8
293
+ }
294
+ }
295
+ 
296
+  at Object.log (tests/hyphen.test.ts:19:13)
297
+
298
+
299
+  RUNS  tests/hyphen.test.ts
300
+
301
+  RUNS  tests/hyphen.test.ts
302
+
303
+  RUNS  tests/hyphen.test.ts
304
+
305
+  RUNS  tests/hyphen.test.ts
306
+
307
+  RUNS  tests/hyphen.test.ts
308
+
309
+  RUNS  tests/hyphen.test.ts
310
+
311
+  RUNS  tests/hyphen.test.ts
312
+
313
+  RUNS  tests/hyphen.test.ts
314
+
315
+  RUNS  tests/hyphen.test.ts
316
+
317
+  RUNS  tests/hyphen.test.ts
318
+
319
+  RUNS  tests/hyphen.test.ts
320
+
321
+
322
+  RUNS  tests/hyphen.test.ts
323
+
324
+
325
+  RUNS  tests/hyphen.test.ts
326
+
327
+
328
+  RUNS  tests/hyphen.test.ts
329
+
330
+
331
+  RUNS  tests/hyphen.test.ts
332
+
333
+
334
+  RUNS  tests/hyphen.test.ts
335
+
336
+
337
+  RUNS  tests/hyphen.test.ts
338
+
339
+
340
+  RUNS  tests/hyphen.test.ts
341
+
342
+
343
+  RUNS  tests/hyphen.test.ts
344
+
345
+
346
+  RUNS  tests/hyphen.test.ts
347
+
348
+
349
+  RUNS  tests/hyphen.test.ts
350
+
351
+
352
+  RUNS  tests/hyphen.test.ts
353
+
354
+
355
+  RUNS  tests/hyphen.test.ts
356
+
357
+
358
+  RUNS  tests/hyphen.test.ts
359
+
360
+
361
+  RUNS  tests/hyphen.test.ts
362
+
363
+
364
+  RUNS  tests/hyphen.test.ts
365
+
366
+
367
+  RUNS  tests/hyphen.test.ts
368
+
369
+ Tests: 12 passed, 12 total
370
+ Snapshots: 0 total
371
+ Time: 3.24 s
372
+ Ran all test suites.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @lunarisapp/hyphen
2
+
3
+ ## 0.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Initial release
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Lunaris Hyphen
2
+
3
+ A hyphenation library based on [LibreOffice dictionaries](https://git.libreoffice.org/dictionaries), inspired by [pyphen](https://github.com/Kozea/Pyphen).
4
+
5
+ > [!TIP]
6
+ > See also:
7
+ > - [@lunarisapp/stats](https://github.com/LunarisApp/text-tools/tree/main/packages/stats) for text statistics (e.g. word count, sentence count, etc.).
8
+ > - [@lunarisapp/readability](https://github.com/LunarisApp/text-tools/tree/main/packages/readability) for text readability scores (e.g. Flesch Reading Ease).
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install @lunarisapp/hyphen
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ ```typescript
19
+ import { TextHyphen } from '@lunarisapp/hyphen';
20
+
21
+ const hyphen = new TextHyphen({
22
+ lang: 'en_US',
23
+ left: 2,
24
+ right: 2,
25
+ });
26
+
27
+ // Gets the hyphenation points for a word.
28
+ // Result: [2, 6]
29
+ hyphen.positions('hyphenation');
30
+
31
+ // Wraps a word with hyphens at the given positions.
32
+ // Result: 'hy-phenation'
33
+ hyphen.wrap('hy-phenation', 3);
34
+
35
+ // Gets the hyphenation variants for a word.
36
+ // Result: [['hy', 'phenation'], ['hyphen', 'ation']]
37
+ hyphen.variants('hyphenation');
38
+
39
+ // Inserts hyphens in all possible positions.
40
+ // Result: 'hy-phen-ation'
41
+ hyphen.inserted('hyphenation');
42
+ ```
43
+
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ presets: [
3
+ ["@babel/preset-env", { targets: { node: "current" } }],
4
+ "@babel/preset-typescript",
5
+ ],
6
+ };