taraskevizer 4.0.0 → 4.1.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/dist/index.cjs +13 -12
- package/dist/index.d.ts +8 -8
- package/dist/index.js +12 -12
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24,6 +24,7 @@ __export(src_exports, {
|
|
|
24
24
|
REPLACE_J: () => REPLACE_J,
|
|
25
25
|
Taraskevizer: () => Taraskevizer,
|
|
26
26
|
VARIATION: () => VARIATION,
|
|
27
|
+
__tarask__: () => __tarask__,
|
|
27
28
|
gobj: () => gobj
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -2062,7 +2063,6 @@ var gwords = [
|
|
|
2062
2063
|
" ґоцц",
|
|
2063
2064
|
" ґрадус",
|
|
2064
2065
|
"ґранд",
|
|
2065
|
-
" ґрош",
|
|
2066
2066
|
"ґрунт",
|
|
2067
2067
|
" ґрэйвэз",
|
|
2068
2068
|
"ґрэнобл",
|
|
@@ -2288,7 +2288,13 @@ var replaceIbyJ = (text, always = false) => text.replace(
|
|
|
2288
2288
|
/([аеёіоуыэюя] )і (ў?)/g,
|
|
2289
2289
|
always ? ($0, $1, $2) => toJ($1, $2) : ($0, $1, $2) => Math.random() >= 0.5 ? toJ($1, $2) : $0
|
|
2290
2290
|
);
|
|
2291
|
-
var
|
|
2291
|
+
var __tarask__ = {
|
|
2292
|
+
wordlist,
|
|
2293
|
+
softers,
|
|
2294
|
+
replaceWithDict,
|
|
2295
|
+
afterTarask
|
|
2296
|
+
};
|
|
2297
|
+
var Taraskevizer = class {
|
|
2292
2298
|
abc = ALPHABET.CYRILLIC;
|
|
2293
2299
|
j = REPLACE_J.NEVER;
|
|
2294
2300
|
html = {
|
|
@@ -2382,23 +2388,17 @@ var Taraskevizer = class _Taraskevizer {
|
|
|
2382
2388
|
return { splittedOrig, splitted, noFixArr };
|
|
2383
2389
|
}
|
|
2384
2390
|
taraskevize(text) {
|
|
2385
|
-
text =
|
|
2391
|
+
text = replaceWithDict(text, wordlist);
|
|
2386
2392
|
softening:
|
|
2387
2393
|
do {
|
|
2388
|
-
text =
|
|
2389
|
-
for (const [pattern, result] of
|
|
2394
|
+
text = replaceWithDict(text, softers);
|
|
2395
|
+
for (const [pattern, result] of softers)
|
|
2390
2396
|
if (result !== "$1дзьдз" && pattern.test(text))
|
|
2391
2397
|
continue softening;
|
|
2392
2398
|
break;
|
|
2393
2399
|
} while (true);
|
|
2394
|
-
return
|
|
2400
|
+
return replaceWithDict(text, afterTarask);
|
|
2395
2401
|
}
|
|
2396
|
-
static _ = {
|
|
2397
|
-
wordlist,
|
|
2398
|
-
softers,
|
|
2399
|
-
replaceWithDict,
|
|
2400
|
-
afterTarask
|
|
2401
|
-
};
|
|
2402
2402
|
};
|
|
2403
2403
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2404
2404
|
0 && (module.exports = {
|
|
@@ -2406,5 +2406,6 @@ var Taraskevizer = class _Taraskevizer {
|
|
|
2406
2406
|
REPLACE_J,
|
|
2407
2407
|
Taraskevizer,
|
|
2408
2408
|
VARIATION,
|
|
2409
|
+
__tarask__,
|
|
2409
2410
|
gobj
|
|
2410
2411
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,12 @@ declare const VARIATION: {
|
|
|
39
39
|
readonly FIRST: 1;
|
|
40
40
|
readonly ALL: 2;
|
|
41
41
|
};
|
|
42
|
+
declare const __tarask__: {
|
|
43
|
+
readonly wordlist: Dict;
|
|
44
|
+
readonly softers: Dict;
|
|
45
|
+
readonly replaceWithDict: (text: string, dict?: ExtendedDict) => string;
|
|
46
|
+
readonly afterTarask: ExtendedDict;
|
|
47
|
+
};
|
|
42
48
|
declare class Taraskevizer {
|
|
43
49
|
abc: Alphabet;
|
|
44
50
|
j: OptionJ;
|
|
@@ -59,13 +65,7 @@ declare class Taraskevizer {
|
|
|
59
65
|
convert(text: string): string;
|
|
60
66
|
convertToHtml(text: string): string;
|
|
61
67
|
private process;
|
|
62
|
-
|
|
63
|
-
static readonly _: {
|
|
64
|
-
readonly wordlist: Dict;
|
|
65
|
-
readonly softers: Dict;
|
|
66
|
-
readonly replaceWithDict: (text: string, dict?: ExtendedDict) => string;
|
|
67
|
-
readonly afterTarask: ExtendedDict;
|
|
68
|
-
};
|
|
68
|
+
protected taraskevize(text: string): string;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
declare const gobj: {
|
|
@@ -75,4 +75,4 @@ declare const gobj: {
|
|
|
75
75
|
readonly Ґ: "Г";
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
export { ALPHABET, type HtmlOptions, type NonHtmlOptions, REPLACE_J, type TaraskOptions, Taraskevizer, VARIATION, gobj };
|
|
78
|
+
export { ALPHABET, type HtmlOptions, type NonHtmlOptions, REPLACE_J, type TaraskOptions, Taraskevizer, VARIATION, __tarask__, gobj };
|
package/dist/index.js
CHANGED
|
@@ -2032,7 +2032,6 @@ var gwords = [
|
|
|
2032
2032
|
" ґоцц",
|
|
2033
2033
|
" ґрадус",
|
|
2034
2034
|
"ґранд",
|
|
2035
|
-
" ґрош",
|
|
2036
2035
|
"ґрунт",
|
|
2037
2036
|
" ґрэйвэз",
|
|
2038
2037
|
"ґрэнобл",
|
|
@@ -2258,7 +2257,13 @@ var replaceIbyJ = (text, always = false) => text.replace(
|
|
|
2258
2257
|
/([аеёіоуыэюя] )і (ў?)/g,
|
|
2259
2258
|
always ? ($0, $1, $2) => toJ($1, $2) : ($0, $1, $2) => Math.random() >= 0.5 ? toJ($1, $2) : $0
|
|
2260
2259
|
);
|
|
2261
|
-
var
|
|
2260
|
+
var __tarask__ = {
|
|
2261
|
+
wordlist,
|
|
2262
|
+
softers,
|
|
2263
|
+
replaceWithDict,
|
|
2264
|
+
afterTarask
|
|
2265
|
+
};
|
|
2266
|
+
var Taraskevizer = class {
|
|
2262
2267
|
abc = ALPHABET.CYRILLIC;
|
|
2263
2268
|
j = REPLACE_J.NEVER;
|
|
2264
2269
|
html = {
|
|
@@ -2352,28 +2357,23 @@ var Taraskevizer = class _Taraskevizer {
|
|
|
2352
2357
|
return { splittedOrig, splitted, noFixArr };
|
|
2353
2358
|
}
|
|
2354
2359
|
taraskevize(text) {
|
|
2355
|
-
text =
|
|
2360
|
+
text = replaceWithDict(text, wordlist);
|
|
2356
2361
|
softening:
|
|
2357
2362
|
do {
|
|
2358
|
-
text =
|
|
2359
|
-
for (const [pattern, result] of
|
|
2363
|
+
text = replaceWithDict(text, softers);
|
|
2364
|
+
for (const [pattern, result] of softers)
|
|
2360
2365
|
if (result !== "$1дзьдз" && pattern.test(text))
|
|
2361
2366
|
continue softening;
|
|
2362
2367
|
break;
|
|
2363
2368
|
} while (true);
|
|
2364
|
-
return
|
|
2369
|
+
return replaceWithDict(text, afterTarask);
|
|
2365
2370
|
}
|
|
2366
|
-
static _ = {
|
|
2367
|
-
wordlist,
|
|
2368
|
-
softers,
|
|
2369
|
-
replaceWithDict,
|
|
2370
|
-
afterTarask
|
|
2371
|
-
};
|
|
2372
2371
|
};
|
|
2373
2372
|
export {
|
|
2374
2373
|
ALPHABET,
|
|
2375
2374
|
REPLACE_J,
|
|
2376
2375
|
Taraskevizer,
|
|
2377
2376
|
VARIATION,
|
|
2377
|
+
__tarask__,
|
|
2378
2378
|
gobj
|
|
2379
2379
|
};
|