taraskevizer 8.0.1 → 8.0.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/index.cjs +8 -15
- package/dist/index.d.ts +19 -5
- package/dist/index.js +8 -15
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -14,7 +14,7 @@ const printWithPrefix = (msg) => {
|
|
|
14
14
|
process.argv.splice(0, 2);
|
|
15
15
|
const checkForOptions = (options) => process.argv[0] && options.includes(process.argv[0].toLowerCase());
|
|
16
16
|
if (checkForOptions(["-v", "--version"])) {
|
|
17
|
-
printWithPrefix("8.0.
|
|
17
|
+
printWithPrefix("8.0.2");
|
|
18
18
|
process.exit(0);
|
|
19
19
|
}
|
|
20
20
|
if (checkForOptions(["-h", "--help"])) {
|
package/dist/index.cjs
CHANGED
|
@@ -2106,7 +2106,6 @@ var tarask = (text, pipeline, cfg = new TaraskConfig()) => {
|
|
|
2106
2106
|
// src/steps/index.ts
|
|
2107
2107
|
var steps_exports = {};
|
|
2108
2108
|
__export(steps_exports, {
|
|
2109
|
-
afterJoin: () => afterJoin,
|
|
2110
2109
|
applyGHtml: () => applyGHtml,
|
|
2111
2110
|
applyGNonHtml: () => applyGNonHtml,
|
|
2112
2111
|
applyNoFix: () => applyNoFix,
|
|
@@ -2123,7 +2122,6 @@ __export(steps_exports, {
|
|
|
2123
2122
|
replaceIbyJ: () => replaceIbyJ,
|
|
2124
2123
|
resolveSpecialSyntax: () => resolveSpecialSyntax,
|
|
2125
2124
|
restoreCaseStep: () => restoreCaseStep,
|
|
2126
|
-
restoreParentheses: () => restoreParentheses,
|
|
2127
2125
|
restoreWhitespaces: () => restoreWhitespaces,
|
|
2128
2126
|
storeSplittedAbcConvertedOrig: () => storeSplittedAbcConvertedOrig,
|
|
2129
2127
|
storeSplittedText: () => storeSplittedText,
|
|
@@ -2513,7 +2511,10 @@ var taraskevize = (options) => {
|
|
|
2513
2511
|
continue softening;
|
|
2514
2512
|
break;
|
|
2515
2513
|
} while (true);
|
|
2516
|
-
options.text = replaceWithDict(
|
|
2514
|
+
options.text = replaceWithDict(
|
|
2515
|
+
text.replace(//g, "").replace(/не пра/g, "не пра"),
|
|
2516
|
+
afterTarask
|
|
2517
|
+
).replace(/не пра/g, "не пра");
|
|
2517
2518
|
};
|
|
2518
2519
|
|
|
2519
2520
|
// src/steps/whitespaces.ts
|
|
@@ -2536,16 +2537,12 @@ var trim = (options) => {
|
|
|
2536
2537
|
options.text = ` ${options.text.trim()} `;
|
|
2537
2538
|
};
|
|
2538
2539
|
|
|
2539
|
-
// src/steps/
|
|
2540
|
-
var restoreParentheses = (options) => {
|
|
2541
|
-
options.text = options.text.replace(/(/g, "(");
|
|
2542
|
-
};
|
|
2543
|
-
var afterJoin = (options) => {
|
|
2544
|
-
options.text = options.text.replace(/ /g, " ").replace(new RegExp(" (\\p{P}|\\p{S}|\\d+|() ", "gu"), "$1");
|
|
2545
|
-
};
|
|
2540
|
+
// src/steps/finalize.ts
|
|
2546
2541
|
var finalize = (newLine) => (options) => {
|
|
2547
|
-
options.text = options.text.replace(/\n/g, newLine).trim();
|
|
2542
|
+
options.text = options.text.replace(/(/g, "(").replace(/ /g, " ").replace(new RegExp(" (\\p{P}|\\p{S}|\\d+) ", "gu"), "$1").replace(/\n/g, newLine).trim();
|
|
2548
2543
|
};
|
|
2544
|
+
|
|
2545
|
+
// src/steps/to-lower-case.ts
|
|
2549
2546
|
var toLowerCase = (options) => {
|
|
2550
2547
|
options.text = options.text.toLowerCase();
|
|
2551
2548
|
};
|
|
@@ -2571,8 +2568,6 @@ var abcOnly = [
|
|
|
2571
2568
|
convertAlphabet,
|
|
2572
2569
|
restoreWhitespaces,
|
|
2573
2570
|
applyNoFix,
|
|
2574
|
-
restoreParentheses,
|
|
2575
|
-
afterJoin,
|
|
2576
2571
|
finalizeWithNewLine,
|
|
2577
2572
|
({ storage, cfg: { general } }) => {
|
|
2578
2573
|
general.doEscapeCapitalized = storage.doEscapeCapitalized;
|
|
@@ -2593,8 +2588,6 @@ var createPipeline = (resolveSpecialSyntax2, applyG, applyVariations, finalize2,
|
|
|
2593
2588
|
highlightDiffStep2,
|
|
2594
2589
|
joinSplittedText,
|
|
2595
2590
|
restoreWhitespaces,
|
|
2596
|
-
restoreParentheses,
|
|
2597
|
-
afterJoin,
|
|
2598
2591
|
applyG,
|
|
2599
2592
|
applyVariations,
|
|
2600
2593
|
applyNoFix,
|
package/dist/index.d.ts
CHANGED
|
@@ -228,6 +228,11 @@ declare const applyVariationsHtml: TaraskStep;
|
|
|
228
228
|
*/
|
|
229
229
|
declare const applyVariationsNonHtml: TaraskStep;
|
|
230
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Prepares the text for correct processing.
|
|
233
|
+
*
|
|
234
|
+
* Some changes should be reverted in the {@link finalize} step.
|
|
235
|
+
*/
|
|
231
236
|
declare const prepare: TaraskStep;
|
|
232
237
|
|
|
233
238
|
/**
|
|
@@ -285,9 +290,20 @@ declare const restoreWhitespaces: TaraskStep<WhiteSpaceStorage>;
|
|
|
285
290
|
|
|
286
291
|
declare const trim: TaraskStep;
|
|
287
292
|
|
|
288
|
-
|
|
289
|
-
|
|
293
|
+
/**
|
|
294
|
+
* @param newLine - The string to replace new lines with.
|
|
295
|
+
*
|
|
296
|
+
* Reverse the changes made in the {@link prepare} step
|
|
297
|
+
* and replace new lines with the passed string.
|
|
298
|
+
*
|
|
299
|
+
* Restores:
|
|
300
|
+
* `(` from `(`,
|
|
301
|
+
* ` ` from ` `,
|
|
302
|
+
*
|
|
303
|
+
* Removes spaces around punctuation marks and digits.
|
|
304
|
+
*/
|
|
290
305
|
declare const finalize: (newLine: string) => TaraskStep;
|
|
306
|
+
|
|
291
307
|
declare const toLowerCase: TaraskStep;
|
|
292
308
|
|
|
293
309
|
/**
|
|
@@ -307,7 +323,6 @@ type index$1_SpecialSyntaxStorage = SpecialSyntaxStorage;
|
|
|
307
323
|
type index$1_SplittedTextStorage = SplittedTextStorage;
|
|
308
324
|
type index$1_TaraskStep<Storage = {}> = TaraskStep<Storage>;
|
|
309
325
|
type index$1_WhiteSpaceStorage = WhiteSpaceStorage;
|
|
310
|
-
declare const index$1_afterJoin: typeof afterJoin;
|
|
311
326
|
declare const index$1_applyGHtml: typeof applyGHtml;
|
|
312
327
|
declare const index$1_applyGNonHtml: typeof applyGNonHtml;
|
|
313
328
|
declare const index$1_applyNoFix: typeof applyNoFix;
|
|
@@ -324,7 +339,6 @@ declare const index$1_prepare: typeof prepare;
|
|
|
324
339
|
declare const index$1_replaceIbyJ: typeof replaceIbyJ;
|
|
325
340
|
declare const index$1_resolveSpecialSyntax: typeof resolveSpecialSyntax;
|
|
326
341
|
declare const index$1_restoreCaseStep: typeof restoreCaseStep;
|
|
327
|
-
declare const index$1_restoreParentheses: typeof restoreParentheses;
|
|
328
342
|
declare const index$1_restoreWhitespaces: typeof restoreWhitespaces;
|
|
329
343
|
declare const index$1_storeSplittedAbcConvertedOrig: typeof storeSplittedAbcConvertedOrig;
|
|
330
344
|
declare const index$1_storeSplittedText: typeof storeSplittedText;
|
|
@@ -333,7 +347,7 @@ declare const index$1_toLowerCase: typeof toLowerCase;
|
|
|
333
347
|
declare const index$1_trim: typeof trim;
|
|
334
348
|
declare const index$1_whitespacesToSpaces: typeof whitespacesToSpaces;
|
|
335
349
|
declare namespace index$1 {
|
|
336
|
-
export { type index$1_SpecialSyntaxStorage as SpecialSyntaxStorage, type index$1_SplittedTextStorage as SplittedTextStorage, type index$1_TaraskStep as TaraskStep, type index$1_WhiteSpaceStorage as WhiteSpaceStorage, index$
|
|
350
|
+
export { type index$1_SpecialSyntaxStorage as SpecialSyntaxStorage, type index$1_SplittedTextStorage as SplittedTextStorage, type index$1_TaraskStep as TaraskStep, type index$1_WhiteSpaceStorage as WhiteSpaceStorage, index$1_applyGHtml as applyGHtml, index$1_applyGNonHtml as applyGNonHtml, index$1_applyNoFix as applyNoFix, index$1_applyVariableParts as applyVariableParts, index$1_applyVariationsHtml as applyVariationsHtml, index$1_applyVariationsNonHtml as applyVariationsNonHtml, index$1_convertAlphabet as convertAlphabet, index$1_convertAlphabetLowerCase as convertAlphabetLowerCase, index$1_finalize as finalize, index$1_highlightDiffStep as highlightDiffStep, index$1_highlightDiffStepNonHtml as highlightDiffStepNonHtml, index$1_joinSplittedText as joinSplittedText, index$1_prepare as prepare, index$1_replaceIbyJ as replaceIbyJ, index$1_resolveSpecialSyntax as resolveSpecialSyntax, index$1_restoreCaseStep as restoreCaseStep, index$1_restoreWhitespaces as restoreWhitespaces, index$1_storeSplittedAbcConvertedOrig as storeSplittedAbcConvertedOrig, index$1_storeSplittedText as storeSplittedText, index$1_taraskevize as taraskevize, index$1_toLowerCase as toLowerCase, index$1_trim as trim, index$1_whitespacesToSpaces as whitespacesToSpaces };
|
|
337
351
|
}
|
|
338
352
|
|
|
339
353
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2079,7 +2079,6 @@ var tarask = (text, pipeline, cfg = new TaraskConfig()) => {
|
|
|
2079
2079
|
// src/steps/index.ts
|
|
2080
2080
|
var steps_exports = {};
|
|
2081
2081
|
__export(steps_exports, {
|
|
2082
|
-
afterJoin: () => afterJoin,
|
|
2083
2082
|
applyGHtml: () => applyGHtml,
|
|
2084
2083
|
applyGNonHtml: () => applyGNonHtml,
|
|
2085
2084
|
applyNoFix: () => applyNoFix,
|
|
@@ -2096,7 +2095,6 @@ __export(steps_exports, {
|
|
|
2096
2095
|
replaceIbyJ: () => replaceIbyJ,
|
|
2097
2096
|
resolveSpecialSyntax: () => resolveSpecialSyntax,
|
|
2098
2097
|
restoreCaseStep: () => restoreCaseStep,
|
|
2099
|
-
restoreParentheses: () => restoreParentheses,
|
|
2100
2098
|
restoreWhitespaces: () => restoreWhitespaces,
|
|
2101
2099
|
storeSplittedAbcConvertedOrig: () => storeSplittedAbcConvertedOrig,
|
|
2102
2100
|
storeSplittedText: () => storeSplittedText,
|
|
@@ -2486,7 +2484,10 @@ var taraskevize = (options) => {
|
|
|
2486
2484
|
continue softening;
|
|
2487
2485
|
break;
|
|
2488
2486
|
} while (true);
|
|
2489
|
-
options.text = replaceWithDict(
|
|
2487
|
+
options.text = replaceWithDict(
|
|
2488
|
+
text.replace(//g, "").replace(/не пра/g, "не пра"),
|
|
2489
|
+
afterTarask
|
|
2490
|
+
).replace(/не пра/g, "не пра");
|
|
2490
2491
|
};
|
|
2491
2492
|
|
|
2492
2493
|
// src/steps/whitespaces.ts
|
|
@@ -2509,16 +2510,12 @@ var trim = (options) => {
|
|
|
2509
2510
|
options.text = ` ${options.text.trim()} `;
|
|
2510
2511
|
};
|
|
2511
2512
|
|
|
2512
|
-
// src/steps/
|
|
2513
|
-
var restoreParentheses = (options) => {
|
|
2514
|
-
options.text = options.text.replace(/(/g, "(");
|
|
2515
|
-
};
|
|
2516
|
-
var afterJoin = (options) => {
|
|
2517
|
-
options.text = options.text.replace(/ /g, " ").replace(new RegExp(" (\\p{P}|\\p{S}|\\d+|() ", "gu"), "$1");
|
|
2518
|
-
};
|
|
2513
|
+
// src/steps/finalize.ts
|
|
2519
2514
|
var finalize = (newLine) => (options) => {
|
|
2520
|
-
options.text = options.text.replace(/\n/g, newLine).trim();
|
|
2515
|
+
options.text = options.text.replace(/(/g, "(").replace(/ /g, " ").replace(new RegExp(" (\\p{P}|\\p{S}|\\d+) ", "gu"), "$1").replace(/\n/g, newLine).trim();
|
|
2521
2516
|
};
|
|
2517
|
+
|
|
2518
|
+
// src/steps/to-lower-case.ts
|
|
2522
2519
|
var toLowerCase = (options) => {
|
|
2523
2520
|
options.text = options.text.toLowerCase();
|
|
2524
2521
|
};
|
|
@@ -2544,8 +2541,6 @@ var abcOnly = [
|
|
|
2544
2541
|
convertAlphabet,
|
|
2545
2542
|
restoreWhitespaces,
|
|
2546
2543
|
applyNoFix,
|
|
2547
|
-
restoreParentheses,
|
|
2548
|
-
afterJoin,
|
|
2549
2544
|
finalizeWithNewLine,
|
|
2550
2545
|
({ storage, cfg: { general } }) => {
|
|
2551
2546
|
general.doEscapeCapitalized = storage.doEscapeCapitalized;
|
|
@@ -2566,8 +2561,6 @@ var createPipeline = (resolveSpecialSyntax2, applyG, applyVariations, finalize2,
|
|
|
2566
2561
|
highlightDiffStep2,
|
|
2567
2562
|
joinSplittedText,
|
|
2568
2563
|
restoreWhitespaces,
|
|
2569
|
-
restoreParentheses,
|
|
2570
|
-
afterJoin,
|
|
2571
2564
|
applyG,
|
|
2572
2565
|
applyVariations,
|
|
2573
2566
|
applyNoFix,
|