taraskevizer 9.2.0 → 9.2.2
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.js +1 -1
- package/dist/lib/after-tarask.d.ts +2 -2
- package/dist/lib/after-tarask.js +15 -11
- package/dist/pipelines.d.ts +9 -8
- package/dist/pipelines.js +2 -2
- package/dist/tarask.d.ts +2 -2
- package/package.json +5 -5
package/dist/bin.js
CHANGED
|
@@ -7,7 +7,7 @@ const printWithPrefix = (msg) => {
|
|
|
7
7
|
process.argv.splice(0, 2);
|
|
8
8
|
const checkForOptions = (options) => process.argv[0] && options.includes(process.argv[0].toLowerCase());
|
|
9
9
|
if (checkForOptions(['-v', '--version'])) {
|
|
10
|
-
printWithPrefix("9.2.
|
|
10
|
+
printWithPrefix("9.2.2");
|
|
11
11
|
process.exit(0);
|
|
12
12
|
}
|
|
13
13
|
if (checkForOptions(['-h', '--help'])) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const endZSoftenAndNiaBiaz:
|
|
1
|
+
import type { Dict } from '../dict/types';
|
|
2
|
+
export declare const endZSoftenAndNiaBiaz: Dict;
|
package/dist/lib/after-tarask.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
const prepositionPattern = /^(?:а[бд]?|б[ея]зь?|[дз]а|д?ля|дзеля|[нп]ад?|пр[аы]|празь?|у|церазь?)$/;
|
|
2
|
-
const isSingleVowel = (str) => str.match(/[аеёіоуыэюя]/g)?.length === 1;
|
|
3
|
-
const isFirstSyllabeStressed = (word) => /^[бвгджзйклмнпхрстфхцчшўьʼ]*.\u0301/.test(word);
|
|
4
1
|
export const endZSoftenAndNiaBiaz = [
|
|
2
|
+
// / не (?=
|
|
3
|
+
// {зычны}*{сымбаль}{націск}
|
|
4
|
+
// |{зычны}*{галосны}{зычны}*{канец слова}
|
|
5
|
+
// )
|
|
6
|
+
// (?!{прыназоўнік})/
|
|
5
7
|
[
|
|
6
|
-
/
|
|
7
|
-
|
|
8
|
+
/ не (?=[бвгджзйклмнпхрстфхцчшўьʼ]*.\u0301|[бвгджзйклмнпхрстфхцчшўьʼ]*[аеёіоуыэюя][бвгджзйклмнпхрстфхцчшўьʼ]* )(?!а[бд]?|б[ея]зь?|[дз]а|д?ля|дзеля|[нп]ад?|пр[аы]|празь?|у|церазь?)/g,
|
|
9
|
+
' ня ',
|
|
8
10
|
],
|
|
11
|
+
// / без(?=ь? (?:
|
|
12
|
+
// {зычны}*{сымбаль}{націск}
|
|
13
|
+
// |{зычны}*{галосны}{зычны}*{канец слова}
|
|
14
|
+
// )/
|
|
9
15
|
[
|
|
10
|
-
/
|
|
11
|
-
|
|
12
|
-
(isSingleVowel($1) && !prepositionPattern.test($1))
|
|
13
|
-
? ' ня ' + $1
|
|
14
|
-
: $0,
|
|
16
|
+
/ без(?=ь? (?:[бвгджзйклмнпхрстфхцчшўьʼ]*.\u0301|[бвгджзйклмнпхрстфхцчшўьʼ]*[аеёіоуыэюя][бвгджзйклмнпхрстфхцчшўьʼ]* ))/g,
|
|
17
|
+
' бяз',
|
|
15
18
|
],
|
|
19
|
+
|
|
16
20
|
[/ б[ея]з(?= і\S*[ая]ў|ну )/g, ' бязь'],
|
|
17
|
-
[/
|
|
21
|
+
[/ (?:пра|цера)?з(?= і\S*[ая]ў|ну )/g, '$&ь'],
|
|
18
22
|
];
|
package/dist/pipelines.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* an array of steps of type {@link steps.TaraskStep}.
|
|
2
|
+
* You can use builtin pipelines from this module or create your own.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* If you want to create a pipeline based on a pre-made one
|
|
4
|
+
* If you want to create a pipeline based on a builtin one
|
|
8
5
|
* and do it more safely, it's recommended to use
|
|
9
6
|
* `.map` if you need replacing only or
|
|
10
7
|
* `.flatMap` if you also need to add or remove steps.
|
|
11
8
|
*
|
|
12
9
|
* This way you will depend less on the
|
|
13
|
-
* internal structure of the
|
|
10
|
+
* internal structure of the builtin pipeline.
|
|
11
|
+
*
|
|
12
|
+
* For cases when you need to replace only {@link steps.taraskevize} in {@link tar}
|
|
13
|
+
* and have better tree-shaking, you can use {@link _createPipeline}.
|
|
14
14
|
*
|
|
15
15
|
* @module
|
|
16
16
|
*/
|
|
@@ -21,6 +21,7 @@ import { type TaraskStep } from './steps';
|
|
|
21
21
|
type AbcOnlyStorage = {
|
|
22
22
|
doEscapeCapitalized: boolean;
|
|
23
23
|
};
|
|
24
|
+
export type Pipeline = TaraskStep<any>[];
|
|
24
25
|
/**
|
|
25
26
|
* Pipeline for changing only the alphabet.
|
|
26
27
|
*
|
|
@@ -38,9 +39,9 @@ export declare const abc: (TaraskStep<import("./steps").SpecialSyntaxStorage> |
|
|
|
38
39
|
*
|
|
39
40
|
* Used by {@link tar} and {@link phonetic}.
|
|
40
41
|
*
|
|
41
|
-
* @param
|
|
42
|
+
* @param subPipeline - Steps used instead of [{@link subPipeline.taraskevize}].
|
|
42
43
|
*/
|
|
43
|
-
export declare const _createPipeline: (
|
|
44
|
+
export declare const _createPipeline: (subPipeline: Pipeline) => (TaraskStep<import("./steps").SplittedTextStorage> | TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage> | TaraskStep<import("./steps").TrimStorage>)[];
|
|
44
45
|
/**
|
|
45
46
|
* Pipeline for taraskevizing.
|
|
46
47
|
*/
|
package/dist/pipelines.js
CHANGED
|
@@ -20,14 +20,14 @@ export const abc = [
|
|
|
20
20
|
}),
|
|
21
21
|
];
|
|
22
22
|
|
|
23
|
-
export const _createPipeline = (
|
|
23
|
+
export const _createPipeline = (subPipeline) => [
|
|
24
24
|
trim,
|
|
25
25
|
resolveSpecialSyntax,
|
|
26
26
|
prepare,
|
|
27
27
|
whitespacesToSpaces,
|
|
28
28
|
storeSplittedAbcConvertedOrig,
|
|
29
29
|
toLowerCase,
|
|
30
|
-
...
|
|
30
|
+
...subPipeline,
|
|
31
31
|
replaceIbyJ,
|
|
32
32
|
convertAlphabetLowerCase,
|
|
33
33
|
storeSplittedText,
|
package/dist/tarask.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TaraskConfig } from './config';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Pipeline } from './pipelines';
|
|
3
3
|
/**
|
|
4
4
|
* @returns converted text
|
|
5
5
|
*
|
|
@@ -7,4 +7,4 @@ import type { TaraskStep } from './steps';
|
|
|
7
7
|
* tarask("планета", pipelines.tar);
|
|
8
8
|
* // "плянэта"
|
|
9
9
|
*/
|
|
10
|
-
export declare const tarask: (text: string, pipeline:
|
|
10
|
+
export declare const tarask: (text: string, pipeline: Pipeline, cfg?: Readonly<TaraskConfig>) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taraskevizer",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"author": "GooseOb",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"module": "dist/index.js",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@digitak/esrun": "^3.2.26",
|
|
13
|
-
"@types/node": "^20.16.
|
|
14
|
-
"bun-types": "^1.1.
|
|
13
|
+
"@types/node": "^20.16.11",
|
|
14
|
+
"bun-types": "^1.1.30",
|
|
15
15
|
"husky": "^9.1.6",
|
|
16
16
|
"prettier": "^3.3.3",
|
|
17
|
-
"typedoc": "^0.26.
|
|
18
|
-
"typescript": "^5.6.
|
|
17
|
+
"typedoc": "^0.26.9",
|
|
18
|
+
"typescript": "^5.6.3"
|
|
19
19
|
},
|
|
20
20
|
"bin": {
|
|
21
21
|
"tarask": "dist/bin.js"
|