@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.
- package/.turbo/turbo-build.log +23 -0
- package/.turbo/turbo-lint.log +12 -0
- package/.turbo/turbo-test.log +372 -0
- package/CHANGELOG.md +7 -0
- package/README.md +43 -0
- package/babel.config.js +6 -0
- package/dist/dictionaries/hyph_af_ZA.dic +5332 -0
- package/dist/dictionaries/hyph_as_IN.dic +100 -0
- package/dist/dictionaries/hyph_be_BY.dic +3385 -0
- package/dist/dictionaries/hyph_bg_BG.dic +6625 -0
- package/dist/dictionaries/hyph_ca.dic +3234 -0
- package/dist/dictionaries/hyph_cs_CZ.dic +3637 -0
- package/dist/dictionaries/hyph_da_DK.dic +1146 -0
- package/dist/dictionaries/hyph_de_AT.dic +77902 -0
- package/dist/dictionaries/hyph_de_CH.dic +77902 -0
- package/dist/dictionaries/hyph_de_DE.dic +77902 -0
- package/dist/dictionaries/hyph_el_GR.dic +579 -0
- package/dist/dictionaries/hyph_en_GB.dic +14062 -0
- package/dist/dictionaries/hyph_en_US.dic +11130 -0
- package/dist/dictionaries/hyph_eo.dic +3407 -0
- package/dist/dictionaries/hyph_es.dic +862 -0
- package/dist/dictionaries/hyph_et_EE.dic +3692 -0
- package/dist/dictionaries/hyph_fr.dic +2914 -0
- package/dist/dictionaries/hyph_gl.dic +290 -0
- package/dist/dictionaries/hyph_hr_HR.dic +1597 -0
- package/dist/dictionaries/hyph_hu_HU.dic +102260 -0
- package/dist/dictionaries/hyph_id_ID.dic +12033 -0
- package/dist/dictionaries/hyph_is.dic +7695 -0
- package/dist/dictionaries/hyph_it_IT.dic +421 -0
- package/dist/dictionaries/hyph_kn_IN.dic +100 -0
- package/dist/dictionaries/hyph_lt.dic +1547 -0
- package/dist/dictionaries/hyph_lv_LV.dic +11900 -0
- package/dist/dictionaries/hyph_mn_MN.dic +1004 -0
- package/dist/dictionaries/hyph_mr_IN.dic +199 -0
- package/dist/dictionaries/hyph_nb_NO.dic +27142 -0
- package/dist/dictionaries/hyph_nl_NL.dic +16257 -0
- package/dist/dictionaries/hyph_nn_NO.dic +27142 -0
- package/dist/dictionaries/hyph_pa_IN.dic +87 -0
- package/dist/dictionaries/hyph_pl_PL.dic +4824 -0
- package/dist/dictionaries/hyph_pt_BR.dic +1247 -0
- package/dist/dictionaries/hyph_pt_PT.dic +308 -0
- package/dist/dictionaries/hyph_ro_RO.dic +5220 -0
- package/dist/dictionaries/hyph_ru_RU.dic +3875 -0
- package/dist/dictionaries/hyph_sa_IN.dic +116 -0
- package/dist/dictionaries/hyph_sk_SK.dic +2468 -0
- package/dist/dictionaries/hyph_sl_SI.dic +1413 -0
- package/dist/dictionaries/hyph_sq_AL.dic +14020 -0
- package/dist/dictionaries/hyph_sr-Latn.dic +3412 -0
- package/dist/dictionaries/hyph_sr.dic +3365 -0
- package/dist/dictionaries/hyph_sv.dic +14954 -0
- package/dist/dictionaries/hyph_te_IN.dic +99 -0
- package/dist/dictionaries/hyph_th_TH.dic +5245 -0
- package/dist/dictionaries/hyph_uk_UA.dic +1654 -0
- package/dist/dictionaries/hyph_zu_ZA.dic +171 -0
- package/dist/index.d.mts +48 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +236 -0
- package/dist/index.mjs +201 -0
- package/eslint.config.js +4 -0
- package/package.json +51 -0
- package/src/dictionaries/hyph_af_ZA.dic +5332 -0
- package/src/dictionaries/hyph_as_IN.dic +100 -0
- package/src/dictionaries/hyph_be_BY.dic +3385 -0
- package/src/dictionaries/hyph_bg_BG.dic +6625 -0
- package/src/dictionaries/hyph_ca.dic +3234 -0
- package/src/dictionaries/hyph_cs_CZ.dic +3637 -0
- package/src/dictionaries/hyph_da_DK.dic +1146 -0
- package/src/dictionaries/hyph_de_AT.dic +77902 -0
- package/src/dictionaries/hyph_de_CH.dic +77902 -0
- package/src/dictionaries/hyph_de_DE.dic +77902 -0
- package/src/dictionaries/hyph_el_GR.dic +579 -0
- package/src/dictionaries/hyph_en_GB.dic +14062 -0
- package/src/dictionaries/hyph_en_US.dic +11130 -0
- package/src/dictionaries/hyph_eo.dic +3407 -0
- package/src/dictionaries/hyph_es.dic +862 -0
- package/src/dictionaries/hyph_et_EE.dic +3692 -0
- package/src/dictionaries/hyph_fr.dic +2914 -0
- package/src/dictionaries/hyph_gl.dic +290 -0
- package/src/dictionaries/hyph_hr_HR.dic +1597 -0
- package/src/dictionaries/hyph_hu_HU.dic +102260 -0
- package/src/dictionaries/hyph_id_ID.dic +12033 -0
- package/src/dictionaries/hyph_is.dic +7695 -0
- package/src/dictionaries/hyph_it_IT.dic +421 -0
- package/src/dictionaries/hyph_kn_IN.dic +100 -0
- package/src/dictionaries/hyph_lt.dic +1547 -0
- package/src/dictionaries/hyph_lv_LV.dic +11900 -0
- package/src/dictionaries/hyph_mn_MN.dic +1004 -0
- package/src/dictionaries/hyph_mr_IN.dic +199 -0
- package/src/dictionaries/hyph_nb_NO.dic +27142 -0
- package/src/dictionaries/hyph_nl_NL.dic +16257 -0
- package/src/dictionaries/hyph_nn_NO.dic +27142 -0
- package/src/dictionaries/hyph_pa_IN.dic +87 -0
- package/src/dictionaries/hyph_pl_PL.dic +4824 -0
- package/src/dictionaries/hyph_pt_BR.dic +1247 -0
- package/src/dictionaries/hyph_pt_PT.dic +308 -0
- package/src/dictionaries/hyph_ro_RO.dic +5220 -0
- package/src/dictionaries/hyph_ru_RU.dic +3875 -0
- package/src/dictionaries/hyph_sa_IN.dic +116 -0
- package/src/dictionaries/hyph_sk_SK.dic +2468 -0
- package/src/dictionaries/hyph_sl_SI.dic +1413 -0
- package/src/dictionaries/hyph_sq_AL.dic +14020 -0
- package/src/dictionaries/hyph_sr-Latn.dic +3412 -0
- package/src/dictionaries/hyph_sr.dic +3365 -0
- package/src/dictionaries/hyph_sv.dic +14954 -0
- package/src/dictionaries/hyph_te_IN.dic +99 -0
- package/src/dictionaries/hyph_th_TH.dic +5245 -0
- package/src/dictionaries/hyph_uk_UA.dic +1654 -0
- package/src/dictionaries/hyph_zu_ZA.dic +171 -0
- package/src/dictionaries/update.sh +7 -0
- package/src/index.ts +235 -0
- package/tests/hyphen.test.ts +118 -0
- 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
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
7
|
+
[34mCLI[39m Using tsconfig: ../../tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.3.6
|
|
9
|
+
[34mCLI[39m Target: esnext
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[33mCJS[39m [33mYou have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin[39m
|
|
13
|
+
[33mESM[39m [33mYou have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m5.59 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 44ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.26 KB[39m
|
|
17
|
+
[32mCJS[39m ⚡️ 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
|
+
[1m[2mDetermining test suites to run...[22m[22m[999D[K
|
|
7
|
+
|
|
8
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
9
|
+
|
|
10
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
11
|
+
|
|
12
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
13
|
+
|
|
14
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
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
|
+
[2m[22m
|
|
296
|
+
[2m [2mat Object.log ([22m[2m[0m[36mtests/hyphen.test.ts[39m[0m[2m:19:13)[22m[2m[22m
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
300
|
+
|
|
301
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
302
|
+
|
|
303
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
304
|
+
|
|
305
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
306
|
+
|
|
307
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
308
|
+
|
|
309
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
310
|
+
|
|
311
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
312
|
+
|
|
313
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
314
|
+
|
|
315
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
316
|
+
|
|
317
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
318
|
+
|
|
319
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
[0m[7m[33m[1m RUNS [22m[39m[27m[0m [2mtests/[22m[1mhyphen.test.ts[22m
|
|
368
|
+
|
|
369
|
+
[1mTests: [22m[1m[32m12 passed[39m[22m, 12 total
|
|
370
|
+
[1mSnapshots: [22m0 total
|
|
371
|
+
[1mTime:[22m 3.24 s
|
|
372
|
+
[2mRan all test suites[22m[2m.[22m
|
package/CHANGELOG.md
ADDED
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
|
+
|