taraskevizer 8.0.8 → 8.0.10
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/bin.d.ts +2 -0
- package/dist/bin.js +126 -173
- package/dist/config.d.ts +14 -0
- package/dist/config.js +35 -0
- package/dist/constants.d.ts +14 -0
- package/dist/constants.js +10 -0
- package/dist/dict/alphabets/arabic.d.ts +3 -0
- package/dist/dict/alphabets/arabic.js +62 -0
- package/dist/dict/alphabets/cyrillic.d.ts +4 -0
- package/dist/dict/alphabets/cyrillic.js +4 -0
- package/dist/dict/alphabets/index.d.ts +4 -0
- package/dist/dict/alphabets/index.js +3 -0
- package/dist/dict/alphabets/latin.d.ts +8 -0
- package/dist/dict/alphabets/latin.js +141 -0
- package/dist/dict/alphabets/types.d.ts +11 -0
- package/dist/dict/alphabets/types.js +1 -0
- package/dist/dict/gobj.d.ts +6 -0
- package/dist/dict/gobj.js +6 -0
- package/dist/dict/index.d.ts +5 -0
- package/dist/dict/index.js +4 -0
- package/dist/dict/iwords.d.ts +4 -0
- package/dist/dict/iwords.js +61 -0
- package/dist/dict/lib.d.ts +12 -0
- package/dist/dict/lib.js +17 -0
- package/dist/dict/softening.d.ts +2 -0
- package/dist/dict/softening.js +21 -0
- package/dist/dict/types.d.ts +15 -0
- package/dist/dict/types.js +1 -0
- package/dist/dict/wordlist.d.ts +2 -0
- package/dist/dict/wordlist.js +1657 -0
- package/dist/index.d.ts +8 -457
- package/dist/index.js +7 -2579
- package/dist/lib/after-tarask.d.ts +2 -0
- package/dist/lib/after-tarask.js +9 -0
- package/dist/lib/highlight-diff.d.ts +1 -0
- package/dist/lib/highlight-diff.js +62 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.js +8 -0
- package/dist/lib/mutating-step.d.ts +8 -0
- package/dist/lib/mutating-step.js +4 -0
- package/dist/lib/replace-g.d.ts +1 -0
- package/dist/lib/replace-g.js +3 -0
- package/dist/lib/replace-with-dict.d.ts +2 -0
- package/dist/lib/replace-with-dict.js +7 -0
- package/dist/lib/restore-case.d.ts +1 -0
- package/dist/lib/restore-case.js +33 -0
- package/dist/lib/types.d.ts +4 -0
- package/dist/lib/types.js +1 -0
- package/dist/lib/wrappers.d.ts +8 -0
- package/dist/lib/wrappers.js +8 -0
- package/dist/pipelines.d.ts +48 -0
- package/dist/pipelines.js +58 -0
- package/dist/steps/apply-g.d.ts +3 -0
- package/dist/steps/apply-g.js +18 -0
- package/dist/steps/apply-variations.d.ts +24 -0
- package/dist/steps/apply-variations.js +18 -0
- package/dist/steps/convert-alphabet.d.ts +2 -0
- package/dist/steps/convert-alphabet.js +3 -0
- package/dist/steps/finalize.d.ts +14 -0
- package/dist/steps/finalize.js +8 -0
- package/dist/steps/highlight-diff.d.ts +9 -0
- package/dist/steps/highlight-diff.js +11 -0
- package/dist/steps/i-to-j.d.ts +2 -0
- package/dist/steps/i-to-j.js +10 -0
- package/dist/steps/index.d.ts +29 -0
- package/dist/steps/index.js +17 -0
- package/dist/steps/join-splitted.d.ts +2 -0
- package/dist/steps/join-splitted.js +2 -0
- package/dist/steps/prepare.d.ts +6 -0
- package/dist/steps/prepare.js +8 -0
- package/dist/steps/resolve-syntax.d.ts +24 -0
- package/dist/steps/resolve-syntax.js +73 -0
- package/dist/steps/restore-case.d.ts +2 -0
- package/dist/steps/restore-case.js +12 -0
- package/dist/steps/store-splitted-abc-converted-orig.d.ts +2 -0
- package/dist/steps/store-splitted-abc-converted-orig.js +4 -0
- package/dist/steps/store-splitted-text.d.ts +2 -0
- package/dist/steps/store-splitted-text.js +3 -0
- package/dist/steps/taraskevize.d.ts +1 -0
- package/dist/steps/taraskevize.js +14 -0
- package/dist/steps/to-lower-case.d.ts +1 -0
- package/dist/steps/to-lower-case.js +2 -0
- package/dist/steps/trim.d.ts +1 -0
- package/dist/steps/trim.js +2 -0
- package/dist/steps/types.d.ts +10 -0
- package/dist/steps/types.js +1 -0
- package/dist/steps/whitespaces.d.ts +20 -0
- package/dist/steps/whitespaces.js +14 -0
- package/dist/tarask.d.ts +10 -0
- package/dist/tarask.js +8 -0
- package/dist/types.d.ts +73 -0
- package/dist/types.js +1 -0
- package/package.json +3 -8
- package/dist/index.cjs +0 -2588
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { toOneLine } from './lib';
|
|
2
|
+
|
|
3
|
+
export const iwords = toOneLine(`біс
|
|
4
|
+
бсэн
|
|
5
|
+
в[аеоы]
|
|
6
|
+
верс
|
|
7
|
+
вал[гз]
|
|
8
|
+
гар
|
|
9
|
+
грышч
|
|
10
|
+
грэк
|
|
11
|
+
дал
|
|
12
|
+
дыш
|
|
13
|
+
жыц
|
|
14
|
+
канапіс
|
|
15
|
+
кань?н
|
|
16
|
+
ка[цўл]
|
|
17
|
+
каў[кц]
|
|
18
|
+
кл(ыя?|а([яей]|га|му)|ую)
|
|
19
|
+
ксі
|
|
20
|
+
леус
|
|
21
|
+
л(іст| )
|
|
22
|
+
лістас
|
|
23
|
+
льк
|
|
24
|
+
м
|
|
25
|
+
мант
|
|
26
|
+
мась?ц
|
|
27
|
+
мбры[кч]
|
|
28
|
+
менна
|
|
29
|
+
мідж
|
|
30
|
+
мпар[тц]
|
|
31
|
+
мпульс[аеуы]
|
|
32
|
+
нахадз
|
|
33
|
+
нды([ійюя] |ев)
|
|
34
|
+
ндэкс(а(ў|мі?)? |[еуыі])
|
|
35
|
+
н[еі][ейяю]
|
|
36
|
+
нк([аіу])
|
|
37
|
+
нтэрым
|
|
38
|
+
нфікс
|
|
39
|
+
нфімум
|
|
40
|
+
ншась?ц
|
|
41
|
+
нш(а[ейя]?|ась?ц|ую|ы(мі?|х|я)?)
|
|
42
|
+
псілан
|
|
43
|
+
р([аыу]|а[мхйў]|амі|)
|
|
44
|
+
рад
|
|
45
|
+
рбіс
|
|
46
|
+
рмас
|
|
47
|
+
рха
|
|
48
|
+
рыс
|
|
49
|
+
скарк
|
|
50
|
+
скарак
|
|
51
|
+
скра
|
|
52
|
+
скравец
|
|
53
|
+
скрачк
|
|
54
|
+
ста
|
|
55
|
+
с[нт]ась?ц
|
|
56
|
+
сь?ці[нк]
|
|
57
|
+
та[р ]
|
|
58
|
+
тры
|
|
59
|
+
х(ны[хя]?|ную|на[яей])?
|
|
60
|
+
ць?він
|
|
61
|
+
шыяс`);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Dict, RawDict, WritableDict } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Collection of functions that help to work with dictionaries.
|
|
4
|
+
*/
|
|
5
|
+
export declare const dictFrom: {
|
|
6
|
+
raw: (dict: RawDict, additionalFlags?: string) => Dict;
|
|
7
|
+
/**
|
|
8
|
+
* Adds the global flag to all patterns in the dictionary.
|
|
9
|
+
*/
|
|
10
|
+
nonGlobal: (dict: WritableDict) => Dict;
|
|
11
|
+
};
|
|
12
|
+
export declare const toOneLine: (str: string) => string;
|
package/dist/dict/lib.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
export const dictFrom = {
|
|
3
|
+
raw: (dict, additionalFlags = 'g') => {
|
|
4
|
+
for (const item of dict)
|
|
5
|
+
item[0] = RegExp(item[0], item[0] instanceof RegExp
|
|
6
|
+
? item[0].flags + additionalFlags
|
|
7
|
+
: additionalFlags);
|
|
8
|
+
return dict;
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
nonGlobal: (dict) => {
|
|
12
|
+
for (const item of dict)
|
|
13
|
+
item[0] = RegExp(item[0], 'g' + item[0].flags);
|
|
14
|
+
return dict;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export const toOneLine = (str) => str.replace(/\n/g, '|');
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { dictFrom } from './lib';
|
|
2
|
+
import { iwords } from './iwords';
|
|
3
|
+
export const noSoften = dictFrom.nonGlobal([
|
|
4
|
+
[/масфільм/, 'мас\ue0ffфільм'],
|
|
5
|
+
[/пэндзлік/, 'пэндз\ue0ffлік'],
|
|
6
|
+
]);
|
|
7
|
+
export const softeners = dictFrom.raw([
|
|
8
|
+
[/([лнц])\1(?=[еёіюяь])/, '$1ь$1'],
|
|
9
|
+
[/(\S\S)дз?дз(?=[еёіюяь])/, '$1дзьдз'],
|
|
10
|
+
[/адзьдз([ея])л/, 'аддз$1л'],
|
|
11
|
+
[/ (п|н|пе?р)адзьдз/, ' $1аддз'],
|
|
12
|
+
[/надзьдзіман/, 'наддзіман'],
|
|
13
|
+
[/з(?=([бвзлмнц]|дз)[еёіюяь])/, 'зь'],
|
|
14
|
+
[/с(?=[бвлмнпсфц][еёіюяь])/, 'сь'],
|
|
15
|
+
[/ц(?=[вм][еёіюяь])/, 'ць'],
|
|
16
|
+
[
|
|
17
|
+
`( (?:б[ея]|пра|цера)?з) (?=\\(?)(?=[еёюяь]|([бвзйлмнпстфц]|дз)[еёіюяь]|імі? |іх(?:ні)?|і(?:${iwords}))`,
|
|
18
|
+
'$1ь ',
|
|
19
|
+
],
|
|
20
|
+
[/([сз])ʼ(?=[яюеё])/, '$1ь'],
|
|
21
|
+
]);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type Dict<T = RegExp> = readonly (readonly [T, string])[];
|
|
2
|
+
/**
|
|
3
|
+
* Useful if you want to modify the dictionary.
|
|
4
|
+
*
|
|
5
|
+
* Consider converting it to the type {@link Dict}
|
|
6
|
+
* if you no longer need to modify it.
|
|
7
|
+
*/
|
|
8
|
+
export type WritableDict<T = RegExp> = [T, string][];
|
|
9
|
+
/**
|
|
10
|
+
* useful if you use variables in patterns.
|
|
11
|
+
*
|
|
12
|
+
* Don't forget to convert it to the type {@link Dict},
|
|
13
|
+
* {@link lib.dictFrom} can help you with this.
|
|
14
|
+
*/
|
|
15
|
+
export type RawDict = WritableDict<string | RegExp>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|